org.apache.thrift.scheme.StandardScheme Java Examples

The following examples show how to use org.apache.thrift.scheme.StandardScheme. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MockResult.java    From thrift-mock with Apache License 2.0 6 votes vote down vote up
public MockResult(String methodName, TBase value) {
  this.methodName = methodName;
  this.success = value;
  this.structDesc = new TStruct(methodName+"_result");

  //init metaDatMap
  Map<_Fields, FieldMetaData> tmpMap = new EnumMap<>(_Fields.class);
  tmpMap.put(_Fields.SUCCESS,
             new FieldMetaData(SUCCESS_NAME, TFieldRequirementType.DEFAULT,
                               new FieldValueMetaData(TType.STRUCT          , value.getClass().getCanonicalName())));
  metaDataMap = Collections.unmodifiableMap(tmpMap);
  FieldMetaData.addStructMetaDataMap(MockResult.class, metaDataMap);

  schemes.put(StandardScheme.class, new MockResultStandardSchemeFactory(structDesc));
  schemes.put(TupleScheme.class, new MockResultTupleSchemeFactory());

}
 
Example #2
Source File: LogEntry.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #3
Source File: scribe.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #4
Source File: scribe.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #5
Source File: LogEntry.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #6
Source File: scribe.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #7
Source File: scribe.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #8
Source File: LogEntry.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #9
Source File: scribe.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #10
Source File: scribe.java    From drift with Apache License 2.0 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto)
{
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #11
Source File: ThriftSimpleService.java    From ikasoa with MIT License 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(
		org.apache.thrift.protocol.TProtocol proto) {
	return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY
			: TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #12
Source File: ThriftSimpleService.java    From ikasoa with MIT License 4 votes vote down vote up
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(
		org.apache.thrift.protocol.TProtocol proto) {
	return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY
			: TUPLE_SCHEME_FACTORY).getScheme();
}
 
Example #13
Source File: TTextProtocol.java    From armeria with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Class<? extends IScheme> getScheme() {
    return StandardScheme.class;
}