use of org.apache.asterix.metadata.entities.Library in project asterixdb by apache.
the class MetadataTransactionContext method dropLibrary.
public void dropLibrary(String dataverseName, String libraryName) {
Library library = new Library(dataverseName, libraryName);
droppedCache.addLibraryIfNotExists(library);
logAndApply(new MetadataLogicalOperation(library, false));
}
use of org.apache.asterix.metadata.entities.Library in project asterixdb by apache.
the class MetadataNode method getLibrary.
@Override
public Library getLibrary(JobId jobId, String dataverseName, String libraryName) throws MetadataException, RemoteException {
try {
ITupleReference searchKey = createTuple(dataverseName, libraryName);
LibraryTupleTranslator tupleReaderWriter = tupleTranslatorProvider.getLibraryTupleTranslator(false);
List<Library> results = new ArrayList<>();
IValueExtractor<Library> valueExtractor = new MetadataEntityValueExtractor<>(tupleReaderWriter);
searchIndex(jobId, MetadataPrimaryIndexes.LIBRARY_DATASET, searchKey, valueExtractor, results);
if (results.isEmpty()) {
return null;
}
return results.get(0);
} catch (HyracksDataException e) {
throw new MetadataException(e);
}
}
Aggregations