static byte[] serialize(AccessControlEntry ace) throws IOException { TMemoryBuffer transport = new TMemoryBuffer(BUFFER_SIZE); TJSONProtocol protocol = new TJSONProtocol(transport); try { ace.write(protocol); transport.flush(); return transport.toString(UTF_8.name()).getBytes(UTF_8); } catch (TException e) { throw new IOException("Failed to serialize access control entry : ", e); } catch (UnsupportedEncodingException uee) { throw new IOException("Failed to serialize acesss control entry : ", uee); } }
String serialize(BKDLConfigFormat configFormat) { TMemoryBuffer transport = new TMemoryBuffer(BUFFER_SIZE); TJSONProtocol protocol = new TJSONProtocol(transport); try { configFormat.write(protocol); transport.flush(); return transport.toString("UTF-8"); } catch (TException e) { throw new RuntimeException("Failed to serialize BKDLConfig : ", e); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Failed to serialize BKDLConfig : ", e); } }
public String toThriftJSONString() throws IOException { org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan(); TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5); TJSONProtocol oprot = new TJSONProtocol(tmb); try { q.write(oprot); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); return q.toString(); } return tmb.toString("UTF-8"); }
public String toThriftJSONString() throws IOException { org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan(); TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5); TJSONProtocol oprot = new TJSONProtocol(tmb); try { q.write(oprot); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); return q.toString(); } return tmb.toString("UTF-8"); }
public byte[] serialize() throws IOException { TMemoryBuffer transport = new TMemoryBuffer(BUFFER_SIZE); TJSONProtocol protocol = new TJSONProtocol(transport); try { toThrift().write(protocol); transport.flush(); return transport.toString(UTF_8.name()).getBytes(UTF_8); } catch (TException e) { throw new IOException("Failed to serialize stream load : ", e); } catch (UnsupportedEncodingException uee) { throw new IOException("Failed to serialize stream load : ", uee); } }
public byte[] serialize() throws IOException { TMemoryBuffer transport = new TMemoryBuffer(BUFFER_SIZE); TJSONProtocol protocol = new TJSONProtocol(transport); try { toThrift().write(protocol); transport.flush(); return transport.toString(UTF_8.name()).getBytes(UTF_8); } catch (TException e) { throw new IOException("Failed to serialize server load : ", e); } catch (UnsupportedEncodingException uee) { throw new IOException("Failed to serialize server load : ", uee); } }
public String toThriftJSONString() throws IOException { org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan(); TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5); TJSONProtocol oprot = new TJSONProtocol(tmb); try { q.write(oprot); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); return q.toString(); } return tmb.toString("UTF-8"); }
public String toThriftJSONString() throws IOException { org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan(); TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5); TJSONProtocol oprot = new TJSONProtocol(tmb); try { q.write(oprot); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); return q.toString(); } return tmb.toString("UTF-8"); }