Search in sources :

Example 1 with Gatherer

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);
}
Also used : TableId(org.apache.accumulo.core.data.TableId) TableNotFoundException(org.apache.accumulo.core.client.TableNotFoundException) Gatherer(org.apache.accumulo.core.summary.Gatherer) ExecutorService(java.util.concurrent.ExecutorService) ThriftTableOperationException(org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) NamespaceId(org.apache.accumulo.core.data.NamespaceId) SummaryCollection(org.apache.accumulo.core.summary.SummaryCollection)

Example 2 with Gatherer

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);
}
Also used : Gatherer(org.apache.accumulo.core.summary.Gatherer) ExecutorService(java.util.concurrent.ExecutorService) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) SummaryCollection(org.apache.accumulo.core.summary.SummaryCollection) TableConfiguration(org.apache.accumulo.server.conf.TableConfiguration)

Example 3 with Gatherer

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);
}
Also used : VolumeManager(org.apache.accumulo.server.fs.VolumeManager) Gatherer(org.apache.accumulo.core.summary.Gatherer) ExecutorService(java.util.concurrent.ExecutorService) BlockCache(org.apache.accumulo.core.spi.cache.BlockCache) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) SummaryCollection(org.apache.accumulo.core.summary.SummaryCollection) TableConfiguration(org.apache.accumulo.server.conf.TableConfiguration) FileSystemResolver(org.apache.accumulo.core.summary.Gatherer.FileSystemResolver)

Aggregations

ExecutorService (java.util.concurrent.ExecutorService)3 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)3 Gatherer (org.apache.accumulo.core.summary.Gatherer)3 SummaryCollection (org.apache.accumulo.core.summary.SummaryCollection)3 TableConfiguration (org.apache.accumulo.server.conf.TableConfiguration)2 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)1 ThriftTableOperationException (org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException)1 NamespaceId (org.apache.accumulo.core.data.NamespaceId)1 TableId (org.apache.accumulo.core.data.TableId)1 BlockCache (org.apache.accumulo.core.spi.cache.BlockCache)1 FileSystemResolver (org.apache.accumulo.core.summary.Gatherer.FileSystemResolver)1 VolumeManager (org.apache.accumulo.server.fs.VolumeManager)1