ContentDataStore getFeatureReaderAppend needs to skip to the end
----------------------------------------------------------------

                 Key: GEOT-3946
                 URL: https://jira.codehaus.org/browse/GEOT-3946
             Project: GeoTools
          Issue Type: Bug
          Components: data
    Affects Versions: 8.0-M2
            Reporter: Jody Garnett
            Assignee: Jody Garnett
            Priority: Minor


A short term fix is simple:
{code}
    public final FeatureWriter<SimpleFeatureType, SimpleFeature> 
getFeatureWriterAppend(String typeName, Transaction tx)
        throws IOException {
        
        ContentFeatureStore featureStore = ensureFeatureStore(typeName,tx);
        FeatureWriter<SimpleFeatureType, SimpleFeature> writer = 
featureStore.getWriter( Filter.INCLUDE , WRITER_ADD );
        
        // ensure we are at the "end" as we are being asked to return this in 
"append" mode
        while( writer.hasNext() ){
            writer.next();
        }
        return writer;
    }
{code}

It would be preferable to:
1. Add an extra flag for WRITER_ADD | WRITER_APPEND
2. Make a featureSource.canAppend() method which returns false
3. Fix it properly
a) In getFeatureReader we can check for canAppend and the flag and skip to the 
end 
b) Allow PropertyDataStoreFeatureReader to respect to flag by skipping to the 
end during the constructor. This would be a speed gain as it could blindly copy 
the lines with no need to parse stuff into features


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

        

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to