本文整理汇总了Java中org.apache.hadoop.io.ObjectWritable.writeObject方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectWritable.writeObject方法的具体用法?Java ObjectWritable.writeObject怎么用?Java ObjectWritable.writeObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.io.ObjectWritable
的用法示例。
在下文中一共展示了ObjectWritable.writeObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.apache.hadoop.io.ObjectWritable; //导入方法依赖的package包/类
public void write(DataOutput out) throws IOException {
UTF8.writeString(out, methodName);
out.writeInt(parameterClasses.length);
for(int i = 0; i < parameterClasses.length; i++){
ObjectWritable.writeObject(out, parameters[i], parameterClasses[i], conf);
}
}
示例2: write
import org.apache.hadoop.io.ObjectWritable; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
Text.writeString(out, fieldName);
Text.writeString(out, mapKey.toString());
WritableUtils.writeEnum(out, filterOp);
WritableUtils.writeVInt(out, operands.size());
for (Object operand : operands) {
if (operand instanceof String) {
throw new IllegalStateException("Use Utf8 instead of String for operands");
}
if (operand instanceof Utf8) {
operand = operand.toString();
}
if (operand instanceof Boolean) {
ObjectWritable.writeObject(out, operand, Boolean.TYPE, conf);
} else if (operand instanceof Character) {
ObjectWritable.writeObject(out, operand, Character.TYPE, conf);
} else if (operand instanceof Byte) {
ObjectWritable.writeObject(out, operand, Byte.TYPE, conf);
} else if (operand instanceof Short) {
ObjectWritable.writeObject(out, operand, Short.TYPE, conf);
} else if (operand instanceof Integer) {
ObjectWritable.writeObject(out, operand, Integer.TYPE, conf);
} else if (operand instanceof Long) {
ObjectWritable.writeObject(out, operand, Long.TYPE, conf);
} else if (operand instanceof Float) {
ObjectWritable.writeObject(out, operand, Float.TYPE, conf);
} else if (operand instanceof Double) {
ObjectWritable.writeObject(out, operand, Double.TYPE, conf);
} else if (operand instanceof Void) {
ObjectWritable.writeObject(out, operand, Void.TYPE, conf);
} else {
ObjectWritable.writeObject(out, operand, operand.getClass(), conf);
}
}
out.writeBoolean(filterIfMissing);
}
示例3: write
import org.apache.hadoop.io.ObjectWritable; //导入方法依赖的package包/类
@Override
public void write(DataOutput out) throws IOException {
Text.writeString(out, fieldName);
WritableUtils.writeEnum(out, filterOp);
WritableUtils.writeVInt(out, operands.size());
for (Object operand : operands) {
if (operand instanceof String) {
throw new IllegalStateException("Use Utf8 instead of String for operands");
}
if (operand instanceof Utf8) {
operand = operand.toString();
}
if (operand instanceof Boolean) {
ObjectWritable.writeObject(out, operand, Boolean.TYPE, conf);
} else if (operand instanceof Character) {
ObjectWritable.writeObject(out, operand, Character.TYPE, conf);
} else if (operand instanceof Byte) {
ObjectWritable.writeObject(out, operand, Byte.TYPE, conf);
} else if (operand instanceof Short) {
ObjectWritable.writeObject(out, operand, Short.TYPE, conf);
} else if (operand instanceof Integer) {
ObjectWritable.writeObject(out, operand, Integer.TYPE, conf);
} else if (operand instanceof Long) {
ObjectWritable.writeObject(out, operand, Long.TYPE, conf);
} else if (operand instanceof Float) {
ObjectWritable.writeObject(out, operand, Float.TYPE, conf);
} else if (operand instanceof Double) {
ObjectWritable.writeObject(out, operand, Double.TYPE, conf);
} else if (operand instanceof Void) {
ObjectWritable.writeObject(out, operand, Void.TYPE, conf);
} else {
ObjectWritable.writeObject(out, operand, operand.getClass(), conf);
}
}
out.writeBoolean(filterIfMissing);
}
示例4: write
import org.apache.hadoop.io.ObjectWritable; //导入方法依赖的package包/类
public void write(DataOutput out) throws IOException {
UTF8.writeString(out, methodName);
out.writeInt(parameterClasses.length);
for (int i = 0; i < parameterClasses.length; i++) {
ObjectWritable.writeObject(out, parameters[i], parameterClasses[i],
conf);
}
}