use of org.apache.hadoop.hive.metastore.FileMetadataHandler in project hive by apache.
the class HBaseStore method getFileMetadataByExpr.
@Override
public void getFileMetadataByExpr(List<Long> fileIds, FileMetadataExprType type, byte[] expr, ByteBuffer[] metadatas, ByteBuffer[] results, boolean[] eliminated) throws MetaException {
FileMetadataHandler fmh = fmHandlers.get(type);
boolean commit = true;
try {
fmh.getFileMetadataByExpr(fileIds, expr, metadatas, results, eliminated);
} catch (IOException e) {
LOG.error("Unable to get file metadata by expr", e);
commit = false;
throw new MetaException("Error reading file metadata by expr" + e.getMessage());
} finally {
commitOrRoleBack(commit);
}
}
use of org.apache.hadoop.hive.metastore.FileMetadataHandler in project hive by apache.
the class HBaseStore method putFileMetadata.
@Override
public void putFileMetadata(List<Long> fileIds, List<ByteBuffer> metadata, FileMetadataExprType type) throws MetaException {
openTransaction();
boolean commit = false;
try {
ByteBuffer[][] addedVals = null;
ByteBuffer[] addedCols = null;
if (type != null) {
FileMetadataHandler fmh = fmHandlers.get(type);
addedCols = fmh.createAddedCols();
if (addedCols != null) {
addedVals = fmh.createAddedColVals(metadata);
}
}
getHBase().storeFileMetadata(fileIds, metadata, addedCols, addedVals);
commit = true;
} catch (IOException | InterruptedException e) {
LOG.error("Unable to store file metadata", e);
throw new MetaException("Error storing file metadata " + e.getMessage());
} finally {
commitOrRoleBack(commit);
}
}
Aggregations