You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by "Chris A. Mattmann (JIRA)" <ji...@apache.org> on 2011/06/18 07:19:47 UTC

[jira] [Resolved] (OODT-199) CoreMetExtractor chokes on Hierarchical Products

     [ https://issues.apache.org/jira/browse/OODT-199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris A. Mattmann resolved OODT-199.
------------------------------------

    Resolution: Fixed

- fixed in r1137127. Rather than engineer for something that we haven't seen yet, let's see an issue from an underlying catalog in ordering the refs and then deal with it then. Until then, I'm just returning the first absolute path of the orig reference (which it only ever looked at the orig ref anyways). Works fine and I added a unit test for regression.

> CoreMetExtractor chokes on Hierarchical Products
> ------------------------------------------------
>
>                 Key: OODT-199
>                 URL: https://issues.apache.org/jira/browse/OODT-199
>             Project: OODT
>          Issue Type: Bug
>          Components: file manager
>    Affects Versions: 0.1-incubating, 0.2
>            Reporter: Chris A. Mattmann
>            Assignee: Chris A. Mattmann
>            Priority: Blocker
>              Labels: core, directory, extractor, met, product
>             Fix For: 0.3
>
>
> While performing some work for a demo recently that involved Product.STRUCTURE_HIERARCHICAL (or *Directory-based*) products, I found out that the CoreMetExtractor chokes and causes ingestion to fail.
> This is due to the following function, which incorrectly assumes that DataStoreReferences exist and that Versioning has already occured:
> {code:java}
>     protected String getRootRefPath(List<Reference> refs,
>             String productTypeRepoPath) throws URISyntaxException {
>         // product type repo: file://foo/path
>         // ref data store path: file:/foo/path/myproddir/dir1/file
>         String productTypeAbsPath = new File(new URI(productTypeRepoPath))
>                 .getAbsolutePath();
>         String anyRefDataStorePath = new File(new URI(refs.get(0)
>                 .getDataStoreReference())).getAbsolutePath();
>         String lastDirPath = anyRefDataStorePath;
>         while (!anyRefDataStorePath.equals(productTypeAbsPath)) {
>             lastDirPath = anyRefDataStorePath;
>             // chop off last dir
>             anyRefDataStorePath = anyRefDataStorePath.substring(0,
>                     anyRefDataStorePath.lastIndexOf("/"));
>         }
>         return lastDirPath;
>     }
> {code}
> A local workaround that appears to be succeeding is assuming that the first Reference even in a Hierarchical product is the initial ref. This works fine for the LuceneCatalog which preserves the ordering of References as they are inserted, but not sure it would work for the DataSourceCatalog which I'm not sure exactly preserves the ordering of References. 
> I'll look into a generalized solution. And I'll add a unit test.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira