Ejemplo n.º 1
0
  private void testSliceByNamesReadCommandWrite() throws IOException {
    SliceByNamesReadCommand standardCmd =
        new SliceByNamesReadCommand(
            statics.KS, statics.Key, statics.StandardCF, statics.readTs, namesPred);
    SliceByNamesReadCommand superCmd =
        new SliceByNamesReadCommand(
            statics.KS, statics.Key, statics.SuperCF, statics.readTs, namesSCPred);

    DataOutputStream out = getOutput("db.SliceByNamesReadCommand.bin");
    SliceByNamesReadCommand.serializer.serialize(standardCmd, out, getVersion());
    SliceByNamesReadCommand.serializer.serialize(superCmd, out, getVersion());
    ReadCommand.serializer.serialize(standardCmd, out, getVersion());
    ReadCommand.serializer.serialize(superCmd, out, getVersion());
    standardCmd.createMessage().serialize(out, getVersion());
    superCmd.createMessage().serialize(out, getVersion());
    out.close();

    // test serializedSize
    testSerializedSize(standardCmd, SliceByNamesReadCommand.serializer);
    testSerializedSize(superCmd, SliceByNamesReadCommand.serializer);
  }