Package org.apache.thrift

Examples of org.apache.thrift.TDeserializer


    }

    private static CfDef cfdefFromString(String st)
    {
        assert st != null;
        TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
        CfDef cfDef = new CfDef();
        try
        {
            deserializer.deserialize(cfDef, Hex.hexToBytes(st));
        }
        catch (TException e)
        {
            throw new RuntimeException(e);
        }
View Full Code Here


    }

    private static List<IndexExpression> indexExpressionsFromString(String ie)
    {
        assert ie != null;
        TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
        IndexClause indexClause = new IndexClause();
        try
        {
            deserializer.deserialize(indexClause, Hex.hexToBytes(ie));
        }
        catch (TException e)
        {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    private static SlicePredicate predicateFromString(String st)
    {
        assert st != null;
        TDeserializer deserializer = new TDeserializer(new TJSONProtocol.Factory());
        SlicePredicate predicate = new SlicePredicate();
        try
        {
            deserializer.deserialize(predicate, st, "UTF-8");
        }
        catch (TException e)
        {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    private static CfDef cfdefFromString(String st)
    {
        assert st != null;
        TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
        CfDef cfDef = new CfDef();
        try
        {
            deserializer.deserialize(cfDef, Hex.hexToBytes(st));
        }
        catch (TException e)
        {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    private static List<IndexExpression> indexExpressionsFromString(String ie)
    {
        assert ie != null;
        TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
        IndexClause indexClause = new IndexClause();
        try
        {
            deserializer.deserialize(indexClause, Hex.hexToBytes(ie));
        }
        catch (TException e)
        {
            throw new RuntimeException(e);
        }
View Full Code Here

        if (scLength > 0)
            super_column = readBuf(scLength, dis);

        byte[] predBytes = new byte[dis.readInt()];
        dis.readFully(predBytes);
        TDeserializer dser = new TDeserializer(new TBinaryProtocol.Factory());
        SlicePredicate pred =  new SlicePredicate();
        try
        {
            dser.deserialize(pred, predBytes);
        }
        catch (TException ex)
        {
            throw new IOException(ex);
        }
View Full Code Here

    /** convert string to a list of index expression */
    private static List<IndexExpression> indexExpressionsFromString(String ie) throws IOException
    {
        assert ie != null;
        TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
        IndexClause indexClause = new IndexClause();
        try
        {
            deserializer.deserialize(indexClause, Hex.hexToBytes(ie));
        }
        catch (TException e)
        {
            throw new IOException(e);
        }
View Full Code Here

    /** convert string back to CfDef */
    protected static CfDef cfdefFromString(String st) throws IOException
    {
        assert st != null;
        TDeserializer deserializer = new TDeserializer(new TBinaryProtocol.Factory());
        CfDef cfDef = new CfDef();
        try
        {
            deserializer.deserialize(cfDef, Hex.hexToBytes(st));
        }
        catch (TException e)
        {
            throw new IOException(e);
        }
View Full Code Here

  }
 
  public static TCredentials fromByteArray(byte[] serializedCredential) throws AccumuloSecurityException {
    if (serializedCredential == null)
      return null;
    TDeserializer td = new TDeserializer();
    try {
      TCredentials toRet = new TCredentials();
      td.deserialize(toRet, serializedCredential);
      return toRet;
    } catch (TException e) {
      // This really shouldn't happen
      log.error(e, e);
      throw new AccumuloSecurityException("unknown", SecurityErrorCode.SERIALIZATION_ERROR);
View Full Code Here

    return encodeIteratorSettings(toIteratorConfig(iterators));
  }


  public static List<IteratorSetting> decodeIteratorSettings(byte[] enc) {
    TDeserializer tdser = new TDeserializer(new TBinaryProtocol.Factory());
    IteratorConfig ic = new IteratorConfig();
    try {
      tdser.deserialize(ic, enc);
    } catch (TException e) {
      throw new RuntimeException(e);
    }
    return toIteratorSettings(ic);
  }
View Full Code Here

TOP

Related Classes of org.apache.thrift.TDeserializer

Copyright © 2018 www.massapicom. 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.