Java Code Examples for org.apache.hadoop.io.WritableUtils#readStringArray()

The following examples show how to use org.apache.hadoop.io.WritableUtils#readStringArray() . 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: TaskReport.java    From hadoop with Apache License 2.0 6 votes vote down vote up
public void readFields(DataInput in) throws IOException {
  this.taskid.readFields(in);
  this.progress = in.readFloat();
  this.state = StringInterner.weakIntern(Text.readString(in));
  this.startTime = in.readLong(); 
  this.finishTime = in.readLong();
  
  diagnostics = WritableUtils.readStringArray(in);
  counters = new Counters();
  counters.readFields(in);
  currentStatus = WritableUtils.readEnum(in, TIPStatus.class);
  if (currentStatus == TIPStatus.RUNNING) {
    int num = WritableUtils.readVInt(in);    
    for (int i = 0; i < num; i++) {
      TaskAttemptID t = new TaskAttemptID();
      t.readFields(in);
      runningAttempts.add(t);
    }
  } else if (currentStatus == TIPStatus.COMPLETE) {
    successfulAttempt.readFields(in);
  }
}
 
Example 2
Source File: TaskReport.java    From big-c with Apache License 2.0 6 votes vote down vote up
public void readFields(DataInput in) throws IOException {
  this.taskid.readFields(in);
  this.progress = in.readFloat();
  this.state = StringInterner.weakIntern(Text.readString(in));
  this.startTime = in.readLong(); 
  this.finishTime = in.readLong();
  
  diagnostics = WritableUtils.readStringArray(in);
  counters = new Counters();
  counters.readFields(in);
  currentStatus = WritableUtils.readEnum(in, TIPStatus.class);
  if (currentStatus == TIPStatus.RUNNING) {
    int num = WritableUtils.readVInt(in);    
    for (int i = 0; i < num; i++) {
      TaskAttemptID t = new TaskAttemptID();
      t.readFields(in);
      runningAttempts.add(t);
    }
  } else if (currentStatus == TIPStatus.COMPLETE) {
    successfulAttempt.readFields(in);
  }
}
 
Example 3
Source File: ProtocolStatus.java    From anthelion with Apache License 2.0 6 votes vote down vote up
public void readFields(DataInput in) throws IOException {
  byte version = in.readByte();
  switch(version) {
  case 1:
    code = in.readByte();
    lastModified = in.readLong();
    args = WritableUtils.readCompressedStringArray(in);
    break;
  case VERSION:
    code = in.readByte();
    lastModified = in.readLong();
    args = WritableUtils.readStringArray(in);
    break;
  default:
    throw new VersionMismatchException(VERSION, version);
  }
}
 
Example 4
Source File: ParseStatus.java    From anthelion with Apache License 2.0 6 votes vote down vote up
public void readFields(DataInput in) throws IOException {
   byte version = in.readByte();
   switch(version) {
   case 1:
     majorCode = in.readByte();
     minorCode = in.readShort();
     args = WritableUtils.readCompressedStringArray(in);
     break;
   case 2:
     majorCode = in.readByte();
     minorCode = in.readShort();
     args = WritableUtils.readStringArray(in);
     break;
   default:
     throw new VersionMismatchException(VERSION, version);
   }
}
 
Example 5
Source File: TaskReport.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public void readFields(DataInput in) throws IOException {
  this.taskid.readFields(in);
  this.progress = in.readFloat();
  this.state = Text.readString(in);
  this.startTime = in.readLong(); 
  this.finishTime = in.readLong();
  
  diagnostics = WritableUtils.readStringArray(in);
  counters = new Counters();
  counters.readFields(in);
  currentStatus = WritableUtils.readEnum(in, TIPStatus.class);
  if (currentStatus == TIPStatus.RUNNING) {
    int num = WritableUtils.readVInt(in);    
    for (int i = 0; i < num; i++) {
      TaskAttemptID t = new TaskAttemptID();
      t.readFields(in);
      runningAttempts.add(t);
    }
  } else if (currentStatus == TIPStatus.COMPLETE) {
    successfulAttempt.readFields(in);
  }
}
 
Example 6
Source File: ProtocolStatus.java    From nutch-htmlunit with Apache License 2.0 6 votes vote down vote up
public void readFields(DataInput in) throws IOException {
  byte version = in.readByte();
  switch(version) {
  case 1:
    code = in.readByte();
    lastModified = in.readLong();
    args = WritableUtils.readCompressedStringArray(in);
    break;
  case VERSION:
    code = in.readByte();
    lastModified = in.readLong();
    args = WritableUtils.readStringArray(in);
    break;
  default:
    throw new VersionMismatchException(VERSION, version);
  }
}
 
Example 7
Source File: ParseStatus.java    From nutch-htmlunit with Apache License 2.0 6 votes vote down vote up
public void readFields(DataInput in) throws IOException {
   byte version = in.readByte();
   switch(version) {
   case 1:
     majorCode = in.readByte();
     minorCode = in.readShort();
     args = WritableUtils.readCompressedStringArray(in);
     break;
   case 2:
     majorCode = in.readByte();
     minorCode = in.readShort();
     args = WritableUtils.readStringArray(in);
     break;
   default:
     throw new VersionMismatchException(VERSION, version);
   }
}
 
Example 8
Source File: TaskReport.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
public void readFields(DataInput in) throws IOException {
  this.taskid.readFields(in);
  this.progress = in.readFloat();
  this.state = Text.readString(in);
  this.startTime = in.readLong(); 
  this.finishTime = in.readLong();
  this.runOnGPU = in.readBoolean();
  
  diagnostics = WritableUtils.readStringArray(in);
  counters = new Counters();
  counters.readFields(in);
  currentStatus = WritableUtils.readEnum(in, TIPStatus.class);
  if (currentStatus == TIPStatus.RUNNING) {
    int num = WritableUtils.readVInt(in);    
    for (int i = 0; i < num; i++) {
      TaskAttemptID t = new TaskAttemptID();
      t.readFields(in);
      runningAttempts.add(t);
    }
  } else if (currentStatus == TIPStatus.COMPLETE) {
    successfulAttempt.readFields(in);
  }
}
 
Example 9
Source File: ForestDocument.java    From marklogic-contentpump with Apache License 2.0 5 votes vote down vote up
@Override
public void readFields(DataInput in) throws IOException {
    fragmentOrdinal = in.readLong();
    collections = WritableUtils.readStringArray(in);
    int numMetadata = in.readInt();
    if (numMetadata > 0) {
        String[] metaStrings = WritableUtils.readStringArray(in);
        metadata = new HashMap<String, String>(numMetadata);
        for (int i = 0; i < metaStrings.length - 1; i++) {
            metadata.put(metaStrings[i], metaStrings[i + 1]);
        }
    }
    quality = in.readInt();
}
 
Example 10
Source File: AegSplit.java    From aegisthus with Apache License 2.0 5 votes vote down vote up
@Override
public void readFields(@Nonnull DataInput in) throws IOException {
    end = in.readLong();
    hosts = WritableUtils.readStringArray(in);
    path = new Path(WritableUtils.readString(in));
    start = in.readLong();
}
 
Example 11
Source File: QueueAclsInfo.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public void readFields(DataInput in) throws IOException {
  queueName = StringInterner.weakIntern(Text.readString(in));
  operations = WritableUtils.readStringArray(in);
}
 
Example 12
Source File: QueueAclsInfo.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public void readFields(DataInput in) throws IOException {
  queueName = StringInterner.weakIntern(Text.readString(in));
  operations = WritableUtils.readStringArray(in);
}
 
Example 13
Source File: QueueAclsInfo.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public void readFields(DataInput in) throws IOException {
  queueName = Text.readString(in);
  operations = WritableUtils.readStringArray(in);
}