当前位置: 首页>>代码示例>>Java>>正文


Java ObjectWritable.writeObject方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:spafka,项目名称:spark_deep,代码行数:8,代码来源:RPC.java

示例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);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:38,代码来源:MapFieldValueFilter.java

示例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);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:37,代码来源:SingleFieldValueFilter.java

示例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);
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:9,代码来源:RPC.java


注:本文中的org.apache.hadoop.io.ObjectWritable.writeObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。