use of org.apache.asterix.metadata.entitytupletranslators.FeedConnectionTupleTranslator in project asterixdb by apache.
the class MetadataNode method getFeedConnection.
@Override
public FeedConnection getFeedConnection(JobId jobId, String dataverseName, String feedName, String datasetName) throws MetadataException, RemoteException {
try {
ITupleReference searchKey = createTuple(dataverseName, feedName, datasetName);
FeedConnectionTupleTranslator tupleReaderWriter = new FeedConnectionTupleTranslator(false);
List<FeedConnection> results = new ArrayList<>();
IValueExtractor<FeedConnection> valueExtractor = new MetadataEntityValueExtractor<>(tupleReaderWriter);
searchIndex(jobId, MetadataPrimaryIndexes.FEED_CONNECTION_DATASET, searchKey, valueExtractor, results);
if (!results.isEmpty()) {
return results.get(0);
}
return null;
} catch (HyracksDataException e) {
throw new MetadataException(e);
}
}
use of org.apache.asterix.metadata.entitytupletranslators.FeedConnectionTupleTranslator in project asterixdb by apache.
the class MetadataNode method getFeedConnections.
@Override
public List<FeedConnection> getFeedConnections(JobId jobId, String dataverseName, String feedName) throws MetadataException, RemoteException {
try {
ITupleReference searchKey = createTuple(dataverseName, feedName);
FeedConnectionTupleTranslator tupleReaderWriter = new FeedConnectionTupleTranslator(false);
List<FeedConnection> results = new ArrayList<>();
IValueExtractor<FeedConnection> valueExtractor = new MetadataEntityValueExtractor<>(tupleReaderWriter);
searchIndex(jobId, MetadataPrimaryIndexes.FEED_CONNECTION_DATASET, searchKey, valueExtractor, results);
return results;
} catch (HyracksDataException e) {
throw new MetadataException(e);
}
}
use of org.apache.asterix.metadata.entitytupletranslators.FeedConnectionTupleTranslator in project asterixdb by apache.
the class MetadataNode method addFeedConnection.
@Override
public void addFeedConnection(JobId jobId, FeedConnection feedConnection) throws MetadataException {
try {
FeedConnectionTupleTranslator tupleReaderWriter = new FeedConnectionTupleTranslator(true);
ITupleReference feedConnTuple = tupleReaderWriter.getTupleFromMetadataEntity(feedConnection);
insertTupleIntoIndex(jobId, MetadataPrimaryIndexes.FEED_CONNECTION_DATASET, feedConnTuple);
} catch (HyracksDataException | ACIDException e) {
throw new MetadataException(e);
}
}
Aggregations