@Override public T getValue(TxnId txnId, ITupleReference tuple) throws AlgebricksException, HyracksDataException, RemoteException { return tupleReaderWriter.getMetadataEntityFromTuple(tuple); } }
/** * Add entity to index * * @param txnId * @param entity * @param tupleTranslator * @param index * @throws AlgebricksException */ private <T> void addEntity(TxnId txnId, T entity, IMetadataEntityTupleTranslator<T> tupleTranslator, IMetadataIndex index) throws AlgebricksException { try { ITupleReference tuple = tupleTranslator.getTupleFromMetadataEntity(entity); insertTupleIntoIndex(txnId, index, tuple); } catch (HyracksDataException e) { throw new AlgebricksException(e); } }
/** * Delete entity from index * * @param txnId * @param entity * @param tupleTranslator * @param index * @throws AlgebricksException */ private <T> void deleteEntity(TxnId txnId, T entity, IMetadataEntityTupleTranslator<T> tupleTranslator, IMetadataIndex index) throws AlgebricksException { try { ITupleReference tuple = tupleTranslator.getTupleFromMetadataEntity(entity); deleteTupleFromIndex(txnId, index, tuple); } catch (HyracksDataException e) { throw new AlgebricksException(e); } }
/** * Upsert entity to index * * @param txnId * @param entity * @param tupleTranslator * @param index * @throws AlgebricksException */ private <T> void upsertEntity(TxnId txnId, T entity, IMetadataEntityTupleTranslator<T> tupleTranslator, IMetadataIndex index) throws AlgebricksException { try { ITupleReference tuple = tupleTranslator.getTupleFromMetadataEntity(entity); upsertTupleIntoIndex(txnId, index, tuple); } catch (HyracksDataException e) { throw new AlgebricksException(e); } }