Examples of LongSerializer


Examples of krati.io.serializer.LongSerializer

*/
public class TestLongSerializer2 extends TestLongSerializer {
   
    @Override
    protected LongSerializer createSerializer() {
        return new LongSerializer(ByteOrder.LITTLE_ENDIAN);
    }
View Full Code Here

Examples of me.prettyprint.cassandra.serializers.LongSerializer

        return hColumn == null ? null : ss.fromByteBuffer( hColumn.getValueBytes() );
    }

    public static Long getAsLongValue( ColumnSlice<String, String> columnSlice, String columnName )
    {
        LongSerializer ls = LongSerializer.get();
        if ( StringUtils.isEmpty( columnName ) )
        {
            return null;
        }

        HColumn<String, String> hColumn = columnSlice.getColumnByName( columnName );
        return hColumn == null ? null : ls.fromByteBuffer( hColumn.getValueBytes() );
    }
View Full Code Here

Examples of me.prettyprint.cassandra.serializers.LongSerializer

    public List<ArtifactMetadata> getArtifactsByDateRange( final String repositoryId, final Date startTime,
                                                           final Date endTime )
        throws MetadataRepositoryException
    {

        LongSerializer ls = LongSerializer.get();
        RangeSlicesQuery<String, String, Long> query = HFactory //
            .createRangeSlicesQuery( keyspace, ss, ss, ls ) //
            .setColumnFamily( cassandraArchivaManager.getArtifactMetadataFamilyName() ) //
            .setColumnNames( "namespaceId", "size", "id", "fileLastModified", "md5", "project", "projectVersion",
                             "repositoryName", "version", "whenGathered", "sha1" ); //
View Full Code Here

Examples of me.prettyprint.cassandra.serializers.LongSerializer

    test(Long.MIN_VALUE);
    test(null);
  }

  private void test(Long number) {
    LongSerializer ext = new LongSerializer();
    assertEquals(number, ext.fromByteBuffer(ext.toByteBuffer(number)));
  }
View Full Code Here

Examples of me.prettyprint.cassandra.serializers.LongSerializer

*/
public class SuperColumnSliceTest {

  @Test
  public void testConstruction() {
    LongSerializer le = LongSerializer.get();
    StringSerializer se = StringSerializer.get();
    ByteBufferSerializer be = ByteBufferSerializer.get();
    // empty one
    List<SuperColumn> tColumns = new ArrayList<SuperColumn>();
    SuperSlice<String, Long, ByteBuffer> slice = new SuperSliceImpl<String, Long, ByteBuffer>(tColumns, se, le,
        be);
    Assert.assertTrue(slice.getSuperColumns().isEmpty());

    // non-empty one
    Column c = new Column(le.toByteBuffer(5L), be.toByteBuffer(ByteBuffer.wrap(new byte[] { 1 })), 2L);
    tColumns.add(new SuperColumn(se.toByteBuffer("super"), Arrays.asList(c)));
    slice = new SuperSliceImpl<String, Long, ByteBuffer>(tColumns, se, le, be);
    Assert.assertEquals(1, slice.getSuperColumns().size());
    Assert.assertEquals((Long) 5L, slice.getColumnByName("super").get(0).getName());
  }
View Full Code Here

Examples of me.prettyprint.cassandra.serializers.LongSerializer


  @Test
  public void testConstruction() {
    StringSerializer se = StringSerializer.get();
    LongSerializer le = LongSerializer.get();
    List<Column> tColumns = new ArrayList<Column>();
    ColumnSlice<String, Long> slice = new ColumnSliceImpl<String, Long>(tColumns, se, le);
    Assert.assertTrue(slice.getColumns().isEmpty());

    tColumns.add(new Column(ByteBuffer.wrap(new byte[]{}), ByteBuffer.wrap(new byte[]{}), 0L));
    slice = new ColumnSliceImpl<String, Long>(tColumns, se, le);
    Assert.assertEquals(1, slice.getColumns().size());

    tColumns = new ArrayList<Column>();
    tColumns.add(new Column(se.toByteBuffer("1"), le.toByteBuffer(1L), 0L));
    slice = new ColumnSliceImpl<String, Long>(tColumns, se, le);
    Assert.assertEquals((Long) 1L, slice.getColumnByName("1").getValue());
  }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.LongSerializer

        copiedPageBTree = new BTree<RevisionName, long[]>( COPIED_PAGE_BTREE_NAME, new RevisionNameSerializer(),
            new LongArraySerializer() );

        // and initialize the Revision BTree
        revisionBTree = new BTree<RevisionName, Long>( REVISION_BTREE_NAME, new RevisionNameSerializer(),
            new LongSerializer() );

        // Inject these BTrees into the RecordManager
        try
        {
            manage( copiedPageBTree );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.LongSerializer

     * @throws IOException If the creation failed
     */
    @BeforeClass
    public static void setup() throws IOException
    {
        btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.LongSerializer

        int nbTrees = 1000;
        int nbElems = 1000;

        for ( int j = 0; j < nbTrees; j++ )
        {
            BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
            btree.setPageSize( 32 );

            for ( int i = 0; i < nbElems; i++ )
            {
                Long key = ( long ) random.nextInt( 1024 );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.LongSerializer

        int nbTrees = 1000;
        int nbElems = 1000;

        for ( int j = 0; j < nbTrees; j++ )
        {
            BTree<Long, String> btree = new BTree<Long, String>( "test", new LongSerializer(), new StringSerializer() );
            btree.setPageSize( 8 );

            for ( int i = 0; i < nbElems; i++ )
            {
                Long key = ( long ) random.nextInt( 1024 );
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.