use of org.apache.accumulo.core.summary.Gatherer in project accumulo by apache.
the class ThriftClientHandler method startGetSummaries.
@Override
public TSummaries startGetSummaries(TInfo tinfo, TCredentials credentials, TSummaryRequest request) throws ThriftSecurityException, ThriftTableOperationException, TException {
NamespaceId namespaceId;
TableId tableId = TableId.of(request.getTableId());
try {
namespaceId = server.getContext().getNamespaceId(tableId);
} catch (TableNotFoundException e1) {
throw new ThriftTableOperationException(tableId.canonical(), null, null, TableOperationExceptionType.NOTFOUND, null);
}
if (!security.canGetSummaries(credentials, tableId, namespaceId)) {
throw new AccumuloSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED).asThriftException();
}
ExecutorService es = server.resourceManager.getSummaryPartitionExecutor();
Future<SummaryCollection> future = new Gatherer(server.getContext(), request, context.getTableConfiguration(tableId), context.getCryptoService()).gather(es);
return startSummaryOperation(credentials, future);
}
use of org.apache.accumulo.core.summary.Gatherer in project accumulo by apache.
the class ThriftClientHandler method startGetSummariesForPartition.
@Override
public TSummaries startGetSummariesForPartition(TInfo tinfo, TCredentials credentials, TSummaryRequest request, int modulus, int remainder) throws ThriftSecurityException, TException {
// do not expect users to call this directly, expect other tservers to call this method
if (!security.canPerformSystemActions(credentials)) {
throw new AccumuloSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED).asThriftException();
}
ExecutorService spe = server.resourceManager.getSummaryRemoteExecutor();
TableConfiguration tableConfig = context.getTableConfiguration(TableId.of(request.getTableId()));
Future<SummaryCollection> future = new Gatherer(server.getContext(), request, tableConfig, context.getCryptoService()).processPartition(spe, modulus, remainder);
return startSummaryOperation(credentials, future);
}
use of org.apache.accumulo.core.summary.Gatherer in project accumulo by apache.
the class ThriftClientHandler method startGetSummariesFromFiles.
@Override
public TSummaries startGetSummariesFromFiles(TInfo tinfo, TCredentials credentials, TSummaryRequest request, Map<String, List<TRowRange>> files) throws ThriftSecurityException, TException {
// do not expect users to call this directly, expect other tservers to call this method
if (!security.canPerformSystemActions(credentials)) {
throw new AccumuloSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED).asThriftException();
}
ExecutorService srp = server.resourceManager.getSummaryRetrievalExecutor();
TableConfiguration tableCfg = context.getTableConfiguration(TableId.of(request.getTableId()));
BlockCache summaryCache = server.resourceManager.getSummaryCache();
BlockCache indexCache = server.resourceManager.getIndexCache();
Cache<String, Long> fileLenCache = server.resourceManager.getFileLenCache();
VolumeManager fs = context.getVolumeManager();
FileSystemResolver volMgr = fs::getFileSystemByPath;
Future<SummaryCollection> future = new Gatherer(server.getContext(), request, tableCfg, context.getCryptoService()).processFiles(volMgr, files, summaryCache, indexCache, fileLenCache, srp);
return startSummaryOperation(credentials, future);
}
Aggregations