Examples of ObjectSerializer


Examples of cascading.flow.hadoop.util.ObjectSerializer

    // to serialize it and if there's an issue, we include the class name
    // of the offending operation in the error.  Otherwise it can be time
    // consuming to track down which operation is causing problems.

    try {
      ObjectSerializer objectSerializer = HadoopUtil.instantiateSerializer(jobConf, operation.getClass());
      try {
        objectSerializer.serialize(operation, true);
      } catch (ObjectStreamException e) {
        throw new RuntimeException("Could not serialize operation: " + operation.getClass().getCanonicalName(), e);
      } catch (IOException e) {
        throw new RuntimeException("Error while trying to serialize: " + operation.getClass().getCanonicalName(), e);
      }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.ObjectSerializer

public class ErrorTest extends TestCase {

    public void test_error() throws Exception {
        SerializeConfig config = new SerializeConfig();
        config.put(A.class, new ObjectSerializer() {

            public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features)
                                                                                                         throws IOException {
                throw new IOException();
            }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.ObjectSerializer

    }

    protected JavaBeanSerializer getJavaBeanSerializer(final Class<?> currentClass) {
        JavaBeanSerializer beanSerializer = null;
        {
            ObjectSerializer serializer = serializeConfig.getObjectWriter(currentClass);
            if (serializer instanceof JavaBeanSerializer) {
                beanSerializer = (JavaBeanSerializer) serializer;
            } else if (serializer instanceof ASMJavaBeanSerializer) {
                beanSerializer = ((ASMJavaBeanSerializer) serializer).getJavaBeanSerializer();
            }
View Full Code Here

Examples of com.hazelcast.nio.serialization.DefaultSerializers.ObjectSerializer

    private void registerJvmTypeSerializers(boolean enableCompression, boolean enableSharedObject) {
        safeRegister(Date.class, new DateSerializer());
        safeRegister(BigInteger.class, new BigIntegerSerializer());
        safeRegister(BigDecimal.class, new BigDecimalSerializer());
        safeRegister(Externalizable.class, new Externalizer(enableCompression));
        safeRegister(Serializable.class, new ObjectSerializer(enableSharedObject, enableCompression));
        safeRegister(Class.class, new ClassSerializer());
        safeRegister(Enum.class, new EnumSerializer());
    }
View Full Code Here

Examples of com.hazelcast.nio.serialization.DefaultSerializers.ObjectSerializer

    private void registerJvmTypeSerializers(boolean enableCompression, boolean enableSharedObject) {
        safeRegister(Date.class, new DateSerializer());
        safeRegister(BigInteger.class, new BigIntegerSerializer());
        safeRegister(BigDecimal.class, new BigDecimalSerializer());
        safeRegister(Externalizable.class, new Externalizer(enableCompression));
        safeRegister(Serializable.class, new ObjectSerializer(enableSharedObject, enableCompression));
        safeRegister(Class.class, new ClassSerializer());
        safeRegister(Enum.class, new EnumSerializer());
    }
View Full Code Here

Examples of net.openhft.lang.io.serialization.ObjectSerializer

        super(builder, kClass, vClass);

        this.timeProvider = builder.timeProvider();
        this.localIdentifier = builder.identifier();
        File file = builder.file();
        ObjectSerializer objectSerializer = builder.objectSerializer();
        BytesStore bytesStore = file == null
                ? DirectStore.allocateLazy(sizeInBytes(), objectSerializer)
                : new MappedStore(file, FileChannel.MapMode.READ_WRITE, sizeInBytes(), objectSerializer);
        createMappedStoreAndSegments(bytesStore);
View Full Code Here

Examples of net.openhft.lang.io.serialization.ObjectSerializer

class VanillaSharedHashMap<K, V> extends AbstractVanillaSharedHashMap<K, V> {

    public VanillaSharedHashMap(SharedHashMapBuilder builder, File file,
                                Class<K> kClass, Class<V> vClass) throws IOException {
        super(builder, kClass, vClass);
        ObjectSerializer objectSerializer = builder.objectSerializer();
        BytesStore bytesStore = file == null
                ? DirectStore.allocateLazy(sizeInBytes(), objectSerializer)
                : new MappedStore(file, FileChannel.MapMode.READ_WRITE, sizeInBytes(), objectSerializer);
        createMappedStoreAndSegments(bytesStore);
    }
View Full Code Here

Examples of net.sf.sojo.interchange.object.ObjectSerializer

     *
     * @see de.netseeker.ejoe.adapter.SerializeAdapter#read(java.io.InputStream)
     */
    public Object read( InputStream in ) throws Exception
    {
        ObjectSerializer deSerializer = new ObjectSerializer();
        // return deSerializer.deserializeFromInputStream( new BufferedInputStream( in ));

        byte[] buffer = new byte[EJConstants.BUFFERED_STREAM_SIZE];
        ByteArrayOutputStream bOut = new ByteArrayOutputStream();
        int length = 0;
        while ( (length = in.read( buffer )) != -1 )
        {
            if ( length > 0 ) bOut.write( buffer, 0, length );
        }
        ByteArrayInputStream bIn = new ByteArrayInputStream( bOut.toByteArray() );
       
        Object obj = null;
       
        try
        {
            obj = deSerializer.deserializeFromInputStream( bIn );
        }
        finally
        {
            IOUtil.closeQuiet( bIn );
        }
View Full Code Here

Examples of net.sf.sojo.interchange.object.ObjectSerializer

     *
     * @see de.netseeker.ejoe.adapter.SerializeAdapter#write(java.lang.Object, java.io.OutputStream)
     */
    public void write( Object obj, OutputStream out ) throws Exception
    {
        ObjectSerializer serializer = new ObjectSerializer();
        FastBufferedOutputStream bOut = new FastBufferedOutputStream( out );
        try
        {
            serializer.serializeToOutputStream( obj, bOut );
        }
        finally
        {
            IOUtil.closeQuiet( bOut );
        }
View Full Code Here

Examples of org.apache.qpid.management.wsdm.muse.serializer.ObjectSerializer

     * @throws Exception when the server startup fails.
     */
    @Override
    protected void setUp() throws Exception
   
      SerializerRegistry.getInstance().registerSerializer(Object.class, new ObjectSerializer());
      SerializerRegistry.getInstance().registerSerializer(Date.class, new DateSerializer());
      SerializerRegistry.getInstance().registerSerializer(Map.class, new MapSerializer());
      SerializerRegistry.getInstance().registerSerializer(HashMap.class, new MapSerializer());
      SerializerRegistry.getInstance().registerSerializer(UUID.class, new UUIDSerializer());
      SerializerRegistry.getInstance().registerSerializer(Result.class, new InvocationResultSerializer());
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.