Examples of IndexStatistics


Examples of org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.IndexStatistics

    }

    for (i = 0; i < blockSizes.length; i++) {
      BucketSizeInfo bucketSizeInfo = mAllocator
          .roundUpToBucketSizeInfo(blockSizes[0]);
      IndexStatistics indexStatistics = bucketSizeInfo.statistics();
      assertTrue(indexStatistics.freeCount() == 0);
    }

    for (long offset : allocations) {
      assertTrue(mAllocator.sizeOfAllocation(offset) == mAllocator
          .freeBlock(offset));
View Full Code Here

Examples of org.exist.storage.statistics.IndexStatistics

    public GetIndexStatistics(XQueryContext context) {
        super(context, signature);
    }

    public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
        final IndexStatistics index = (IndexStatistics) context.getBroker().getBrokerPool().
                getIndexManager().getIndexById(IndexStatistics.ID);
        if (index == null) {
            // module may not be enabled
            return Sequence.EMPTY_SEQUENCE;
        }

        final SAXAdapter adapter = new SAXAdapter(context);
        try {
            adapter.startDocument();
            index.toSAX(adapter);
            adapter.endDocument();
        } catch (final SAXException e) {
            throw new XPathException(this, "Error caught while retrieving statistics: " + e.getMessage(), e);
        }
        final DocumentImpl doc = (DocumentImpl) adapter.getDocument();
View Full Code Here

Examples of org.graylog2.indexer.indices.IndexStatistics

    @Nullable
    @Override
    public Result shouldRotate(final String index) {

        final IndexStatistics indexStats = indices.getIndexStats(index);
        if (indexStats == null) {
            return null;
        }

        final long sizeInBytes = indexStats.getPrimaries().store.getSizeInBytes();

        final boolean shouldRotate = sizeInBytes > maxSize;

        return new Result() {
            public final MessageFormat ROTATE = new MessageFormat("Storage size for index <{0}> is {1} bytes, exceeding the maximum of {2} bytes. Rotating index.");
View Full Code Here

Examples of org.graylog2.indexer.indices.IndexStatistics

    @Test
    public void testRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        final IndexStatistics stats = new IndexStatistics();
        final CommonStats commonStats = new CommonStats();
        commonStats.store = new StoreStats(1000, 0);
        stats.setPrimaries(commonStats);

        when(indices.getIndexStats("name")).thenReturn(stats);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100L);

        final SizeBasedRotationStrategy strategy = new SizeBasedRotationStrategy(configuration,
View Full Code Here

Examples of org.graylog2.indexer.indices.IndexStatistics

    @Test
    public void testDontRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        final IndexStatistics stats = new IndexStatistics();
        final CommonStats commonStats = new CommonStats();
        commonStats.store = new StoreStats(1000, 0);
        stats.setPrimaries(commonStats);

        when(indices.getIndexStats("name")).thenReturn(stats);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100000L);

        final SizeBasedRotationStrategy strategy = new SizeBasedRotationStrategy(configuration,
View Full Code Here

Examples of org.graylog2.indexer.indices.IndexStatistics

        }

        final ImmutableMap.Builder<String, Object> result = ImmutableMap.builder();

        try {
            final IndexStatistics stats = indices.getIndexStats(index);
            if (stats == null) {
                LOG.error("Index [{}] not found.", index);
                return Response.status(404).build();
            }

            final ImmutableList.Builder<Map<String, Object>> routing = ImmutableList.builder();
            for (ShardRouting shardRouting : stats.getShardRoutings()) {
                routing.add(shardRouting(shardRouting));
            }

            result.put("primary_shards", indexStats(stats.getPrimaries()));
            result.put("all_shards", indexStats(stats.getTotal()));
            result.put("routing", routing.build());
            result.put("is_reopened", indices.isReopened(index));
        } catch (Exception e) {
            LOG.error("Could not get indices information.", e);
            return Response.serverError().build();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.