Examples of deserialize()


Examples of org.apache.hadoop.record.RecRecord1.deserialize()

    FileInputStream istream = new FileInputStream(tmpfile);
    DataInputStream distream = new DataInputStream(istream);
    TypedBytesRecordInput in = TypedBytesRecordInput.get(distream);
    RecRecord1 r2 = new RecRecord1();
    r2.deserialize(in, "");
    distream.close();
    istream.close();
    assertEquals(r1, r2);
  }
View Full Code Here

Examples of org.apache.hadoop.record.meta.RecordTypeInfo.deserialize()

      FileInputStream istream = new FileInputStream(tmpfile);
      BinaryRecordInput in = new BinaryRecordInput(istream);
      FileInputStream iRTIstream = new FileInputStream(tmpRTIfile);
      BinaryRecordInput inRTI = new BinaryRecordInput(iRTIstream);
      RecordTypeInfo rti = new RecordTypeInfo();
      rti.deserialize(inRTI);
      iRTIstream.close();
      RecRecord1.setTypeFilter(rti);
      RecRecord1 r2 = new RecRecord1();
      r2.deserialize(in, "");
      istream.close();
View Full Code Here

Examples of org.apache.hadoop.yarn.api.records.SerializedException.deSerialize()

  @Test(timeout=10000)
  public void testSerializedExceptionDeSer() throws Exception{
    // without cause
    YarnException yarnEx = new YarnException("Yarn_Exception");
    SerializedException serEx = SerializedException.newInstance(yarnEx);
    Throwable throwable = serEx.deSerialize();
    Assert.assertEquals(yarnEx.getClass(), throwable.getClass());
    Assert.assertEquals(yarnEx.getMessage(), throwable.getMessage());

    // with cause
    IOException ioe = new IOException("Test_IOException");
View Full Code Here

Examples of org.apache.hadoop.yarn.api.records.impl.pb.SerializedExceptionPBImpl.deSerialize()

  public void testDeserialize() throws Exception {
    Exception ex = new Exception("test exception");
    SerializedExceptionPBImpl pb = new SerializedExceptionPBImpl();

    try {
      pb.deSerialize();
      Assert.fail("deSerialze should throw YarnRuntimeException");
    } catch (YarnRuntimeException e) {
      Assert.assertEquals(ClassNotFoundException.class,
          e.getCause().getClass());
    }
View Full Code Here

Examples of org.apache.helix.manager.zk.ZNRecordSerializer.deserialize()

    ZNRecord znRecord = new ZNRecord(RECORD_ID);
    znRecord.setPayloadSerializer(new JacksonPayloadSerializer());
    znRecord.setPayload(sample);
    ZNRecordSerializer znRecordSerializer = new ZNRecordSerializer();
    byte[] serialized = znRecordSerializer.serialize(znRecord);
    ZNRecord deserialized = (ZNRecord) znRecordSerializer.deserialize(serialized);
    deserialized.setPayloadSerializer(new JacksonPayloadSerializer());
    SampleDeserialized duplicate = deserialized.getPayload(SampleDeserialized.class);
    Assert.assertEquals(duplicate, sample);
  }
View Full Code Here

Examples of org.apache.helix.manager.zk.ZNRecordStreamingSerializer.deserialize()

    ZNRecord znRecord = new ZNRecord(RECORD_ID);
    znRecord.setPayloadSerializer(new JacksonPayloadSerializer());
    znRecord.setPayload(sample);
    ZNRecordStreamingSerializer znRecordSerializer = new ZNRecordStreamingSerializer();
    byte[] serialized = znRecordSerializer.serialize(znRecord);
    ZNRecord deserialized = (ZNRecord) znRecordSerializer.deserialize(serialized);
    deserialized.setPayloadSerializer(new JacksonPayloadSerializer());
    SampleDeserialized duplicate = deserialized.getPayload(SampleDeserialized.class);
    Assert.assertEquals(duplicate, sample);
  }
View Full Code Here

Examples of org.apache.http.entity.EntityDeserializer.deserialize()

    }

    public void testIllegalGenerateArg() throws Exception {
        EntityDeserializer entitygen = new DefaultEntityDeserializer();
        try {
            entitygen.deserialize(null, null);
            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
View Full Code Here

Examples of org.apache.http.impl.entity.DefaultEntityDeserializer.deserialize()

    }

    public void testIllegalGenerateArg() throws Exception {
        EntityDeserializer entitygen = new DefaultEntityDeserializer();
        try {
            entitygen.deserialize(null, null);
            fail("IllegalArgumentException should have been thrown");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        try {
View Full Code Here

Examples of org.apache.jackrabbit.core.cluster.ClusterRecordDeserializer.deserialize()

            }
            try {
                while (processor.getNumEvents() < MIN_BUFFER_SIZE && records.hasNext()) {
                    Record record = records.nextRecord();
                    if (record.getProducerId().equals(producerId)) {
                        ClusterRecord cr = deserializer.deserialize(record);
                        if (!session.getWorkspace().getName().equals(cr.getWorkspace())) {
                            continue;
                        }
                        cr.process(processor);
                        lastRevision = new Long(cr.getRevision());
View Full Code Here

Examples of org.apache.jute.Record.deserialize()

        case OpCode.error:
            txn = new ErrorTxn();
            break;
        }
        if (txn != null) {
            txn.deserialize(ia, "txn");
        }
        return txn;
    }

    public static void deserializeSnapshot(DataTree dt,InputArchive ia,
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.