[ 
https://issues.apache.org/jira/browse/RYA-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15336316#comment-15336316
 ] 

ASF GitHub Bot commented on RYA-51:
-----------------------------------

Github user pujav65 commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/48#discussion_r67529527
  
    --- Diff: dao/mongodb.rya/src/main/java/mvm/rya/mongodb/MongoDBRyaDAO.java 
---
    @@ -179,85 +145,85 @@ public void destroy() throws RyaDAOException {
             IOUtils.closeQuietly(queryEngine);
         }
     
    -   public void add(RyaStatement statement) throws RyaDAOException {        
        
    -           // add it to the collection
    -           try {
    -                   coll.insert(storageStrategy.serialize(statement));
    -                   for(RyaSecondaryIndexer index: secondaryIndexers) {
    -                       index.storeStatement(statement);
    -                   }
    -           }
    -           catch (com.mongodb.MongoException.DuplicateKey exception){
    -                   // ignore
    -           }
    -           catch (com.mongodb.DuplicateKeyException exception){
    -                   // ignore
    -           }
    -           catch (Exception ex){
    -                   // ignore single exceptions
    -                   ex.printStackTrace();
    -           }
    -   }
    -   
    -   public void add(Iterator<RyaStatement> statement) throws 
RyaDAOException {
    -           List<DBObject> dbInserts = new ArrayList<DBObject>();
    -           while (statement.hasNext()){
    -                   RyaStatement ryaStatement = statement.next();
    -                   DBObject insert = 
storageStrategy.serialize(ryaStatement);
    -                   dbInserts.add(insert);
    -                   
    +    @Override
    +    public void add(final RyaStatement statement) throws RyaDAOException {
    +        // add it to the collection
    +        try {
    +            coll.insert(storageStrategy.serialize(statement));
    +            for(final RyaSecondaryIndexer index: secondaryIndexers) {
    +                index.storeStatement(statement);
    +            }
    +        } catch (final IOException e) {
    +            log.error("Unable to add: " + statement.toString());
    +            throw new RyaDAOException(e);
    +        }
    +    }
    +
    +    @Override
    +    public void add(final Iterator<RyaStatement> statement) throws 
RyaDAOException {
    +        final List<DBObject> dbInserts = new ArrayList<DBObject>();
    +        while (statement.hasNext()){
    +            final RyaStatement ryaStatement = statement.next();
    +            final DBObject insert = 
storageStrategy.serialize(ryaStatement);
    +            dbInserts.add(insert);
    +
                 try {
    -                for (RyaSecondaryIndexer index : secondaryIndexers) {
    +                for (final RyaSecondaryIndexer index : secondaryIndexers) {
                         index.storeStatement(ryaStatement);
                     }
    -            } catch (IOException e) {
    -                throw new RyaDAOException(e);
    +            } catch (final IOException e) {
    +                log.error("Failed to add: " + ryaStatement.toString() + " 
to the indexer");
                 }
    -            
    -           }
    -           coll.insert(dbInserts, new 
InsertOptions().continueOnError(true));
    -   }
    -
    -   public void delete(RyaStatement statement, MongoDBRdfConfiguration conf)
    -                   throws RyaDAOException {
    -           DBObject obj = storageStrategy.getQuery(statement);
    -           coll.remove(obj);
    -   }
    -
    -   public void dropGraph(MongoDBRdfConfiguration conf, RyaURI... graphs)
    -                   throws RyaDAOException {
    -           
    -   }
    -
    -   public void delete(Iterator<RyaStatement> statements,
    -                   MongoDBRdfConfiguration conf) throws RyaDAOException {
    -           while (statements.hasNext()){
    -                   RyaStatement ryaStatement = statements.next();
    -                   coll.remove(storageStrategy.getQuery(ryaStatement));
    -           }
    -           
    -   }
    -
    -   public String getVersion() throws RyaDAOException {
    -           return "1.0";
    -   }
    -
    -   public RyaQueryEngine<MongoDBRdfConfiguration> getQueryEngine() {
    -           return queryEngine;
    -   }
    -
    -   public RyaNamespaceManager<MongoDBRdfConfiguration> 
getNamespaceManager() {
    -           return nameSpaceManager;
    -   }
    -
    -   public void purge(RdfCloudTripleStoreConfiguration configuration) {
    -           // TODO Auto-generated method stub
    -           
    -   }
    -
    -   public void dropAndDestroy() throws RyaDAOException {
    -           db.dropDatabase(); // this is dangerous!
    -   }
     
    +        }
    +        coll.insert(dbInserts, new InsertOptions().continueOnError(true));
    +    }
    +
    +    @Override
    +    public void delete(final RyaStatement statement, final 
MongoDBRdfConfiguration conf)
    +            throws RyaDAOException {
    +        final DBObject obj = storageStrategy.getQuery(statement);
    --- End diff --
    
    delete from secondary indexers


> Temporal indexing support for MongoDB
> -------------------------------------
>
>                 Key: RYA-51
>                 URL: https://issues.apache.org/jira/browse/RYA-51
>             Project: Rya
>          Issue Type: New Feature
>          Components: dao
>            Reporter: Puja Valiyil 
>            Assignee: Puja Valiyil 
>
> There should be temporal indexing support for Mongo DB backed Rya.  i imagine 
> this would be implemented using another collection, similar to how temporal 
> indexing is implemented in Rya with a supplementary table.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to