tools/stress/src/org/apache/cassandra/stress/util/Operation.java
//Functions for generating stats that match FB
Functions for generating stats that match FB
Functions for generating stats that match FB
protected ArrayList<ByteBuffer> generateFBValues()
    {
        ArrayList<ByteBuffer> values = new ArrayList<ByteBuffer>();
        int uniqueValues = Math.min(session.getCardinality(), 10000);
        for (int i = 0; i < uniqueValues; i++)
        {
            String hash = getMD5(Integer.toString(i));
            int columnSize = getFBColumnSize();
            int times = columnSize / hash.length();
            int sumReminder = columnSize % hash.length();
            String value = new StringBuilder(multiplyString(hash, times)).append(hash.substring(0, sumReminder)).toString();
            values.add(ByteBuffer.wrap(value.getBytes()));
        }
        return values;
    }
protected ArrayList < ByteBuffer > generateFBValues ( ) { ArrayList < ByteBuffer > values = new ArrayList < ByteBuffer > ( ) ; int uniqueValues = Math . min ( session . getCardinality ( ) , 10000 ) ; for ( int i = 0 ; i < uniqueValues ; i ++ ) { String hash = getMD5 ( Integer . toString ( i ) ) ; int columnSize = getFBColumnSize ( ) ; int times = columnSize / hash . length ( ) ; int sumReminder = columnSize % hash . length ( ) ; String value = new StringBuilder ( multiplyString ( hash , times ) ) . append ( hash . substring ( 0 , sumReminder ) ) . toString ( ) ; values . add ( ByteBuffer . wrap ( value . getBytes ( ) ) ) ; } return values ; }
Functions for generating stats that match FB
Functions for generating stats that match FB