private void checkVersion() throws RyaDAOException, IOException, MutationsRejectedException { final String version = getVersion(); if (version == null) { //adding to core Rya tables but not Indexes final Map<TABLE_LAYOUT, Collection<Mutation>> mutationMap = ryaTableMutationsFactory.serialize(getVersionRyaStatement()); final Collection<Mutation> spo = mutationMap.get(TABLE_LAYOUT.SPO); final Collection<Mutation> po = mutationMap.get(TABLE_LAYOUT.PO); final Collection<Mutation> osp = mutationMap.get(TABLE_LAYOUT.OSP); bw_spo.addMutations(spo); bw_po.addMutations(po); bw_osp.addMutations(osp); } //TODO: Do a version check here }
private void checkVersion() throws RyaDAOException, IOException, MutationsRejectedException { final String version = getVersion(); if (version == null) { //adding to core Rya tables but not Indexes final Map<TABLE_LAYOUT, Collection<Mutation>> mutationMap = ryaTableMutationsFactory.serialize(getVersionRyaStatement()); final Collection<Mutation> spo = mutationMap.get(TABLE_LAYOUT.SPO); final Collection<Mutation> po = mutationMap.get(TABLE_LAYOUT.PO); final Collection<Mutation> osp = mutationMap.get(TABLE_LAYOUT.OSP); bw_spo.addMutations(spo); bw_po.addMutations(po); bw_osp.addMutations(osp); } //TODO: Do a version check here }
protected void commit(final Iterator<RyaStatement> commitStatements) throws RyaDAOException { try { //TODO: Should have a lock here in case we are adding and committing at the same time while (commitStatements.hasNext()) { final RyaStatement stmt = commitStatements.next(); final Map<TABLE_LAYOUT, Collection<Mutation>> mutationMap = ryaTableMutationsFactory.serialize(stmt); final Collection<Mutation> spo = mutationMap.get(TABLE_LAYOUT.SPO); final Collection<Mutation> po = mutationMap.get(TABLE_LAYOUT.PO); final Collection<Mutation> osp = mutationMap.get(TABLE_LAYOUT.OSP); bw_spo.addMutations(spo); bw_po.addMutations(po); bw_osp.addMutations(osp); for (final AccumuloIndexer index : secondaryIndexers) { index.storeStatement(stmt); } } if (flushEachUpdate.get()) { mt_bw.flush(); } } catch (final Exception e) { throw new RyaDAOException(e); } }
protected void commit(final Iterator<RyaStatement> commitStatements) throws RyaDAOException { try { //TODO: Should have a lock here in case we are adding and committing at the same time while (commitStatements.hasNext()) { final RyaStatement stmt = commitStatements.next(); final Map<TABLE_LAYOUT, Collection<Mutation>> mutationMap = ryaTableMutationsFactory.serialize(stmt); final Collection<Mutation> spo = mutationMap.get(TABLE_LAYOUT.SPO); final Collection<Mutation> po = mutationMap.get(TABLE_LAYOUT.PO); final Collection<Mutation> osp = mutationMap.get(TABLE_LAYOUT.OSP); bw_spo.addMutations(spo); bw_po.addMutations(po); bw_osp.addMutations(osp); for (final AccumuloIndexer index : secondaryIndexers) { index.storeStatement(stmt); } } if (flushEachUpdate.get()) { mt_bw.flush(); } } catch (final Exception e) { throw new RyaDAOException(e); } }
private void writeRyaMutations(final RyaStatement ryaStatement, final Context context, final boolean isDelete) throws IOException, InterruptedException { if (ryaStatement.getColumnVisibility() == null) { ryaStatement.setColumnVisibility(AccumuloRdfConstants.EMPTY_CV.getExpression()); } final Map<TABLE_LAYOUT, Collection<Mutation>> mutationMap = ryaTableMutationFactory.serialize(ryaStatement); final Collection<Mutation> spoMutations = mutationMap.get(TABLE_LAYOUT.SPO); final Collection<Mutation> poMutations = mutationMap.get(TABLE_LAYOUT.PO); final Collection<Mutation> ospMutations = mutationMap.get(TABLE_LAYOUT.OSP); for (final Mutation mutation : spoMutations) { writeMutation(spoTable, mutation, context, isDelete); } for (final Mutation mutation : poMutations) { writeMutation(poTable, mutation, context, isDelete); } for (final Mutation mutation : ospMutations) { writeMutation(ospTable, mutation, context, isDelete); } }