gpt4 book ai didi

org.apache.crunch.types.writable.Writables.derived()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 05:51:05 30 4
gpt4 key购买 nike

本文整理了Java中org.apache.crunch.types.writable.Writables.derived()方法的一些代码示例,展示了Writables.derived()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Writables.derived()方法的具体详情如下:
包路径:org.apache.crunch.types.writable.Writables
类名称:Writables
方法名:derived

Writables.derived介绍

暂无

代码示例

代码示例来源:origin: cloudera/crunch

@Override
 public <S, T> PType<T> derived(Class<T> clazz, MapFn<S, T> inputFn,
   MapFn<T, S> outputFn, PType<S> base) {
  return Writables.derived(clazz, inputFn, outputFn, base);
 }
}

代码示例来源:origin: org.apache.crunch/crunch

@Override
 public <S, T> PType<T> derived(Class<T> clazz, MapFn<S, T> inputFn, MapFn<T, S> outputFn, PType<S> base) {
  return Writables.derived(clazz, inputFn, outputFn, base);
 }
}

代码示例来源:origin: org.apache.crunch/crunch-core

@Override
public <S, T> PType<T> derived(Class<T> clazz, MapFn<S, T> inputFn, MapFn<T, S> outputFn, PType<S> base) {
 return Writables.derived(clazz, inputFn, outputFn, base);
}

代码示例来源:origin: org.apache.crunch/crunch-hbase

public static final PType<KeyValue> keyValues() {
 return Writables.derived(KeyValue.class,
   new MapFn<BytesWritable, KeyValue>() {
    @Override
    public KeyValue map(BytesWritable input) {
     return bytesToKeyValue(input);
    }
   },
   new MapFn<KeyValue, BytesWritable>() {
    @Override
    public BytesWritable map(KeyValue input) {
     return keyValueToBytes(input);
    }
   },
   Writables.writables(BytesWritable.class));
}

代码示例来源:origin: org.apache.crunch/crunch-hbase

public static final PType<Cell> cells() {
 return Writables.derived(Cell.class,
   new MapFn<BytesWritable, Cell>() {
    @Override
    public Cell map(BytesWritable input) {
     return bytesToKeyValue(input);
    }
   },
   new MapFn<Cell, BytesWritable>() {
    @Override
    public BytesWritable map(Cell input) {
     return keyValueToBytes(input);
    }
   },
   Writables.writables(BytesWritable.class));
}

代码示例来源:origin: apache/crunch

public static final PType<KeyValue> keyValues() {
 return Writables.derived(KeyValue.class,
   new MapFn<BytesWritable, KeyValue>() {
    @Override
    public KeyValue map(BytesWritable input) {
     return bytesToKeyValue(input);
    }
   },
   new MapFn<KeyValue, BytesWritable>() {
    @Override
    public BytesWritable map(KeyValue input) {
     return keyValueToBytes(input);
    }
   },
   Writables.writables(BytesWritable.class));
}

代码示例来源:origin: apache/crunch

public static final PType<Cell> cells() {
 return Writables.derived(Cell.class,
   new MapFn<BytesWritable, Cell>() {
    @Override
    public Cell map(BytesWritable input) {
     return bytesToKeyValue(input);
    }
   },
   new MapFn<Cell, BytesWritable>() {
    @Override
    public BytesWritable map(Cell input) {
     return keyValueToBytes(input);
    }
   },
   Writables.writables(BytesWritable.class));
}

代码示例来源:origin: org.apache.crunch/crunch-hbase

public static final PType<Put> puts() {
 return Writables.derived(Put.class,
   new MapInFn<Put>(Put.class, MutationSerialization.class),
   new MapOutFn<Put>(Put.class, MutationSerialization.class),
   Writables.bytes());
}

代码示例来源:origin: org.apache.crunch/crunch-hbase

public static final PType<Result> results() {
 return Writables.derived(Result.class,
   new MapInFn<Result>(Result.class, ResultSerialization.class),
   new MapOutFn<Result>(Result.class, ResultSerialization.class),
   Writables.bytes());
}

代码示例来源:origin: org.apache.crunch/crunch-hbase

public static final PType<Delete> deletes() {
 return Writables.derived(Delete.class,
   new MapInFn<Delete>(Delete.class, MutationSerialization.class),
   new MapOutFn<Delete>(Delete.class, MutationSerialization.class),
   Writables.bytes());
}

代码示例来源:origin: apache/crunch

public static final PType<Put> puts() {
 return Writables.derived(Put.class,
   new MapInFn<Put>(Put.class, MutationSerialization.class),
   new MapOutFn<Put>(Put.class, MutationSerialization.class),
   Writables.bytes());
}

代码示例来源:origin: apache/crunch

public static final PType<Delete> deletes() {
 return Writables.derived(Delete.class,
   new MapInFn<Delete>(Delete.class, MutationSerialization.class),
   new MapOutFn<Delete>(Delete.class, MutationSerialization.class),
   Writables.bytes());
}

代码示例来源:origin: apache/crunch

public static final PType<Result> results() {
 return Writables.derived(Result.class,
   new MapInFn<Result>(Result.class, ResultSerialization.class),
   new MapOutFn<Result>(Result.class, ResultSerialization.class),
   Writables.bytes());
}

代码示例来源:origin: apache/crunch

/**
 * Create a PType to directly use OrcStruct as the deserialized format. This
 * is the fastest way for serialization/deserializations. However, users
 * need to use ObjectInspectors to handle the OrcStruct. Currently, void and
 * union types are not supported.
 * 
 * @param typeInfo
 * @return
 */
public static final PType<OrcStruct> orcs(TypeInfo typeInfo) {
 return Writables.derived(OrcStruct.class, new OrcInFn(typeInfo), new OrcOutFn(typeInfo),
   Writables.writables(OrcWritable.class));
}

代码示例来源:origin: apache/crunch

/**
 * Create a PType which uses reflection to serialize/deserialize java POJOs
 * to/from ORC. There are some restrictions of the POJO: 1) it must have a
 * default, no-arg constructor; 2) All of its fields must be Hive primitive
 * types or collection types that have Hive equivalents; 3) Void and Union
 * are not supported yet.
 * 
 * @param clazz
 * @return
 */
public static final <T> PType<T> reflects(Class<T> clazz) {
 TypeInfo reflectInfo = createReflectTypeInfo(clazz);
 return Writables.derived(clazz, new ReflectInFn<T>(clazz),
   new ReflectOutFn<T>(clazz), orcs(reflectInfo));
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com