Package org.apache.cassandra.utils

Examples of org.apache.cassandra.utils.EstimatedHistogram


        }

        @Override
        protected long doIndexing() throws IOException
        {
            EstimatedHistogram rowSizes = SSTable.defaultRowHistogram();
            EstimatedHistogram columnCounts = SSTable.defaultColumnHistogram();
            long rows = 0L;
            DecoratedKey key;

            CompactionController controller = CompactionController.getBasicController(true);

            long dfileLength = dfile.length();
            while (!dfile.isEOF())
            {
                // read key
                key = SSTableReader.decodeKey(StorageService.getPartitioner(), desc, ByteBufferUtil.readWithShortLength(dfile));

                // skip data size, bloom filter, column index
                long dataSize = SSTableReader.readRowSize(dfile, desc);
                SSTableIdentityIterator iter = new SSTableIdentityIterator(cfs.metadata, dfile, key, dfile.getFilePointer(), dataSize, true);

                AbstractCompactedRow row;
                if (dataSize > DatabaseDescriptor.getInMemoryCompactionLimit())
                {
                    logger.info(String.format("Rebuilding post-streaming large counter row %s (%d bytes) incrementally", ByteBufferUtil.bytesToHex(key.key), dataSize));
                    row = new LazilyCompactedRow(controller, Collections.singletonList(iter));
                }
                else
                {
                    row = new PrecompactedRow(controller, Collections.singletonList(iter));
                }

                updateCache(key, dataSize, row);

                rowSizes.add(dataSize);
                columnCounts.add(row.columnCount());

                // update index writer
                iwriter.afterAppend(key, writerDfile.getFilePointer());
                // write key and row
                ByteBufferUtil.writeWithShortLength(key.key, writerDfile);
View Full Code Here


        estimatedColumnCount = columnCounts;
    }

    static EstimatedHistogram defaultColumnHistogram()
    {
        return new EstimatedHistogram(114);
    }
View Full Code Here

        return new EstimatedHistogram(114);
    }

    static EstimatedHistogram defaultRowHistogram()
    {
        return new EstimatedHistogram(150);
    }
View Full Code Here

    private void printCfHistograms(String keySpace, String columnFamily, PrintStream output)
    {
        ColumnFamilyStoreMBean store = this.probe.getCfsProxy(keySpace, columnFamily);

        // default is 90 offsets
        long[] offsets = new EstimatedHistogram().getBucketOffsets();

        long[] rrlh = store.getRecentReadLatencyHistogramMicros();
        long[] rwlh = store.getRecentWriteLatencyHistogramMicros();
        long[] sprh = store.getRecentSSTablesPerReadHistogram();
        long[] ersh = store.getEstimatedRowSizeHistogram();
View Full Code Here

        return maxTimestamp;
    }

    static EstimatedHistogram defaultColumnHistogram()
    {
        return new EstimatedHistogram(114);
    }
View Full Code Here

        return new EstimatedHistogram(114);
    }

    static EstimatedHistogram defaultRowHistogram()
    {
        return new EstimatedHistogram(150);
    }
View Full Code Here

                dis = new DataInputStream(new BufferedInputStream(new FileInputStream(statsFile)));

                if (!descriptor.usesHistogramAndReplayPositionStatsFile)
                  return deserialize(dis);

                EstimatedHistogram rowSizes = EstimatedHistogram.serializer.deserialize(dis);
                EstimatedHistogram columnCounts = EstimatedHistogram.serializer.deserialize(dis);
                ReplayPosition replayPosition = descriptor.hasReplayPosition()
                                              ? ReplayPosition.serializer.deserialize(dis)
                                              : ReplayPosition.NONE;

                return new SSTableMetadata(rowSizes, columnCounts, replayPosition);
View Full Code Here

            }
        }

        public SSTableMetadata deserialize(DataInput dis) throws IOException
        {
            EstimatedHistogram rowSizes = EstimatedHistogram.serializer.deserialize(dis);
            EstimatedHistogram columnCounts = EstimatedHistogram.serializer.deserialize(dis);
            ReplayPosition replayPosition = ReplayPosition.serializer.deserialize(dis);
            long maxTimestamp = dis.readLong();
            return new SSTableMetadata(rowSizes, columnCounts, replayPosition, maxTimestamp);
        }
View Full Code Here

    }

    static EstimatedHistogram defaultColumnCountHistogram()
    {
        // EH of 114 can track a max value of 2395318855, i.e., > 2B columns
        return new EstimatedHistogram(114);
    }
View Full Code Here

    }

    static EstimatedHistogram defaultRowSizeHistogram()
    {
        // EH of 150 can track a max value of 1697806495183, i.e., > 1.5PB
        return new EstimatedHistogram(150);
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.utils.EstimatedHistogram

Copyright © 2018 www.massapicom. 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.