Search in sources :

Example 1 with BsonDataCodec

use of com.linkedin.data.codec.BsonDataCodec in project rest.li by linkedin.

the class TestData method testBsonStressBufferSizeDataCodec.

@Test
public void testBsonStressBufferSizeDataCodec() throws IOException {
    for (int i = 16; i < 32; ++i) {
        BsonDataCodec codec = new BsonDataCodec(i, true);
        testDataCodec(codec);
    }
}
Also used : BsonDataCodec(com.linkedin.data.codec.BsonDataCodec) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 2 with BsonDataCodec

use of com.linkedin.data.codec.BsonDataCodec in project rest.li by linkedin.

the class TestData method testBsonDataCodec.

/*
  @Test
  public void testBson4JacksonDataCodec() throws IOException
  {
    Bson4JacksonDataCodec codec = new Bson4JacksonDataCodec();
    testDataCodec(codec);
  }
  */
@Test
public void testBsonDataCodec() throws IOException {
    BsonDataCodec codec = new BsonDataCodec();
    testDataCodec(codec);
}
Also used : BsonDataCodec(com.linkedin.data.codec.BsonDataCodec) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 3 with BsonDataCodec

use of com.linkedin.data.codec.BsonDataCodec in project rest.li by linkedin.

the class TestData method perfTest.

private void perfTest(int count, DataMap map) throws IOException {
    List<DataCodec> codecs = new ArrayList<DataCodec>();
    codecs.add(new JacksonDataCodec());
    //codecs.add(new Bson4JacksonDataCodec());
    codecs.add(new BsonDataCodec());
    for (DataCodec codec : codecs) {
        byte[] bytes = codec.mapToBytes(map);
        out.println(codec.getClass().getName() + " serialized size " + bytes.length);
    }
    for (DataCodec codec : codecs) {
        dataMapToBytesPerfTest(count, codec, map);
    }
    for (DataCodec codec : codecs) {
        byte[] bytes = codec.mapToBytes(map);
        bytesToDataMapPerfTest(count, codec, bytes);
    }
}
Also used : PsonDataCodec(com.linkedin.data.codec.PsonDataCodec) JacksonDataCodec(com.linkedin.data.codec.JacksonDataCodec) BsonDataCodec(com.linkedin.data.codec.BsonDataCodec) DataCodec(com.linkedin.data.codec.DataCodec) TextDataCodec(com.linkedin.data.codec.TextDataCodec) JacksonDataCodec(com.linkedin.data.codec.JacksonDataCodec) BsonDataCodec(com.linkedin.data.codec.BsonDataCodec) ArrayList(java.util.ArrayList)

Aggregations

BsonDataCodec (com.linkedin.data.codec.BsonDataCodec)3 BeforeTest (org.testng.annotations.BeforeTest)2 Test (org.testng.annotations.Test)2 DataCodec (com.linkedin.data.codec.DataCodec)1 JacksonDataCodec (com.linkedin.data.codec.JacksonDataCodec)1 PsonDataCodec (com.linkedin.data.codec.PsonDataCodec)1 TextDataCodec (com.linkedin.data.codec.TextDataCodec)1 ArrayList (java.util.ArrayList)1