コード例 #1
0
ファイル: Content.java プロジェクト: Earne/HiBench
  public final void readFields(DataInput in) throws IOException {
    metadata.clear();
    int sizeOrVersion = in.readInt();
    if (sizeOrVersion < 0) { // version
      version = sizeOrVersion;
      switch (version) {
        case VERSION:
          url = Text.readString(in);
          base = Text.readString(in);

          content = new byte[in.readInt()];
          in.readFully(content);

          contentType = Text.readString(in);
          metadata.readFields(in);
          break;
        default:
          throw new VersionMismatchException((byte) VERSION, (byte) version);
      }
    } else { // size
      byte[] compressed = new byte[sizeOrVersion];
      in.readFully(compressed, 0, compressed.length);
      ByteArrayInputStream deflated = new ByteArrayInputStream(compressed);
      DataInput inflater = new DataInputStream(new InflaterInputStream(deflated));
      readFieldsCompressed(inflater);
    }
  }
コード例 #2
0
 @Override
 public void readFields(DataInput dataInput) throws IOException {
   leftCoordinate = dataInput.readLong();
   samRecord = Text.readString(dataInput);
   rfname = Text.readString(dataInput);
   // sqTag = Text.readString(dataInput);
 }
コード例 #3
0
 public void readFields(DataInput in) throws IOException {
   this.locId = in.readInt();
   this.country = Text.readString(in);
   this.region = Text.readString(in);
   this.city = Text.readString(in);
   this.postalCode = Text.readString(in);
   this.latitude = in.readInt();
   this.longitude = in.readInt();
   this.metroCode = in.readInt();
   this.areaCode = in.readInt();
 }
コード例 #4
0
  /* (non-Javadoc)
   * @see org.apache.hadoop.io.Writable#readFields(java.io.DataInput)
   */
  public void readFields(DataInput in) throws IOException {
    resetForm();

    int numDeleteTerms = in.readInt();
    for (int i = 0; i < numDeleteTerms; i++) {
      String field = Text.readString(in);
      String text = Text.readString(in);
      deleteList.add(new Term(field, text));
    }

    RAMDirectoryUtil.readRAMFiles(in, dir);
  }
コード例 #5
0
 public void readFields(DataInput in) throws IOException {
   numActiveTrackers = in.readInt();
   int numTrackerNames = in.readInt();
   if (numTrackerNames > 0) {
     for (int i = 0; i < numTrackerNames; i++) {
       String name = Text.readString(in);
       activeTrackers.add(name);
     }
   }
   numBlacklistedTrackers = in.readInt();
   int blackListTrackerInfoSize = in.readInt();
   if (blackListTrackerInfoSize > 0) {
     for (int i = 0; i < blackListTrackerInfoSize; i++) {
       BlackListInfo info = new BlackListInfo();
       info.readFields(in);
       blacklistedTrackersInfo.add(info);
     }
   }
   numExcludedNodes = in.readInt();
   ttExpiryInterval = in.readLong();
   map_tasks = in.readInt();
   reduce_tasks = in.readInt();
   max_map_tasks = in.readInt();
   max_reduce_tasks = in.readInt();
   used_memory = in.readLong();
   max_memory = in.readLong();
   state = WritableUtils.readEnum(in, JobTracker.State.class);
 }
コード例 #6
0
ファイル: region.java プロジェクト: jmccann-pivotal/POC-Tools
 public void readFields(DataInput __dataIn) throws IOException {
   if (__dataIn.readBoolean()) {
     this.r_regionkey = null;
   } else {
     this.r_regionkey = Integer.valueOf(__dataIn.readInt());
   }
   if (__dataIn.readBoolean()) {
     this.r_name = null;
   } else {
     this.r_name = Text.readString(__dataIn);
   }
   if (__dataIn.readBoolean()) {
     this.r_comment = null;
   } else {
     this.r_comment = Text.readString(__dataIn);
   }
 }
コード例 #7
0
ファイル: TaskStatus.java プロジェクト: koichi626/hadoop-gpu
 public void readFields(DataInput in) throws IOException {
   this.taskid.readFields(in);
   this.progress = in.readFloat();
   this.runState = WritableUtils.readEnum(in, State.class);
   this.diagnosticInfo = Text.readString(in);
   this.stateString = Text.readString(in);
   this.phase = WritableUtils.readEnum(in, Phase.class);
   this.startTime = in.readLong();
   this.finishTime = in.readLong();
   counters = new Counters();
   this.includeCounters = in.readBoolean();
   this.outputSize = in.readLong();
   if (includeCounters) {
     counters.readFields(in);
   }
   nextRecordRange.readFields(in);
   this.runOnGPU = in.readBoolean();
 }
コード例 #8
0
ファイル: ARCSplit.java プロジェクト: czxxjtu/commoncrawl
 /** @inheritDoc */
 public void readFields(DataInput in) throws IOException {
   int nResources = in.readInt();
   resources = new ARCResource[nResources];
   for (int i = 0; i < nResources; i++) {
     resources[i] = new ARCResource(Text.readString(in), in.readLong());
   }
   size = in.readLong();
   hosts = null;
 }
コード例 #9
0
ファイル: QueueInfo.java プロジェクト: FloodDragon/hadoop
 @Override
 public void readFields(DataInput in) throws IOException {
   queueName = StringInterner.weakIntern(Text.readString(in));
   queueState = WritableUtils.readEnum(in, QueueState.class);
   schedulingInfo = StringInterner.weakIntern(Text.readString(in));
   int length = in.readInt();
   stats = new JobStatus[length];
   for (int i = 0; i < length; i++) {
     stats[i] = new JobStatus();
     stats[i].readFields(in);
   }
   int count = in.readInt();
   children.clear();
   for (int i = 0; i < count; i++) {
     QueueInfo childQueueInfo = new QueueInfo();
     childQueueInfo.readFields(in);
     children.add(childQueueInfo);
   }
 }
コード例 #10
0
 @Override
 public void readFields(DataInput in) throws IOException {
   this.length = in.readLong();
   int numDirs = in.readInt();
   this.indexDirs = Lists.newLinkedList();
   for (int i = 0; i < numDirs; i++) {
     String path = Text.readString(in);
     this.indexDirs.add(new Path(path));
   }
 }
コード例 #11
0
 @Override
 public void readFields(DataInput in) throws IOException {
   String strPath = Text.readString(in, Text.DEFAULT_MAX_LEN);
   this.path = new Path(strPath);
   this.length = in.readLong();
   this.isdir = in.readBoolean();
   this.block_replication = in.readShort();
   blocksize = in.readLong();
   modification_time = in.readLong();
   access_time = in.readLong();
   permission.readFields(in);
   owner = Text.readString(in, Text.DEFAULT_MAX_LEN);
   group = Text.readString(in, Text.DEFAULT_MAX_LEN);
   if (in.readBoolean()) {
     this.symlink = new Path(Text.readString(in, Text.DEFAULT_MAX_LEN));
   } else {
     this.symlink = null;
   }
 }
コード例 #12
0
ファイル: Content.java プロジェクト: Earne/HiBench
  private final void readFieldsCompressed(DataInput in) throws IOException {
    byte oldVersion = in.readByte();
    switch (oldVersion) {
      case 0:
      case 1:
        url = UTF8.readString(in); // read url
        base = UTF8.readString(in); // read base

        content = new byte[in.readInt()]; // read content
        in.readFully(content);

        contentType = UTF8.readString(in); // read contentType
        // reconstruct metadata
        int keySize = in.readInt();
        String key;
        for (int i = 0; i < keySize; i++) {
          key = UTF8.readString(in);
          int valueSize = in.readInt();
          for (int j = 0; j < valueSize; j++) {
            metadata.add(key, UTF8.readString(in));
          }
        }
        break;
      case 2:
        url = Text.readString(in); // read url
        base = Text.readString(in); // read base

        content = new byte[in.readInt()]; // read content
        in.readFully(content);

        contentType = Text.readString(in); // read contentType
        metadata.readFields(in); // read meta data
        break;
      default:
        throw new VersionMismatchException((byte) 2, oldVersion);
    }
  }
コード例 #13
0
 @Override
 public void readFields(DataInput in) throws IOException {
   clear();
   final int termCount = WritableUtils.readVInt(in);
   for (int i = 0; i < termCount; i++) {
     final String term = Text.readString(in);
     final int freq = WritableUtils.readVInt(in);
     final int bf = WritableUtils.readVInt(in);
     insert(freq, term);
     if (bf == 0) continue;
     final int[] blocks = new int[bf];
     blocks[0] = WritableUtils.readVInt(in) - 1;
     for (int j = 1; j < bf; j++) blocks[j] = WritableUtils.readVInt(in) - blocks[j - 1];
     term_blocks.put(term, new TIntHashSet(blocks));
   }
 }
コード例 #14
0
 @Override
 public void readFields(DataInput in) throws IOException {
   String className = Text.readString(in);
   try {
     predicate = (TypeValuePredicate) Class.forName(className).newInstance();
     predicate.readFields(in);
   } catch (InstantiationException e) {
     throw new IOException(
         "Exception deserialising predicate in " + this.getClass().getName() + ": " + e);
   } catch (IllegalAccessException e) {
     throw new IOException(
         "Exception deserialising predicate in " + this.getClass().getName() + ": " + e);
   } catch (ClassNotFoundException e) {
     throw new IOException(
         "Exception deserialising predicate in " + this.getClass().getName() + ": " + e);
   } catch (ClassCastException e) {
     throw new IOException(
         "Exception deserialising predicate in " + this.getClass().getName() + ": " + e);
   }
 }
コード例 #15
0
ファイル: TaskReport.java プロジェクト: JichengSong/hadoop-20
  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);
    }
  }
コード例 #16
0
 public void readFields(DataInput in) throws IOException {
   broker = Text.readString(in);
   topic = Text.readString(in);
   partition = in.readInt();
   lastCommit = in.readLong();
 }
コード例 #17
0
ファイル: GeneratorJob.java プロジェクト: zhuchi/nutch-ajax
 public void readFields(DataInput in) throws IOException {
   url = Text.readString(in);
   score = in.readFloat();
 }
コード例 #18
0
 public void readFields(DataInput in) throws IOException {
   this.url = Text.readString(in);
   this.pageview = in.readLong();
 }
コード例 #19
0
ファイル: ProductPair.java プロジェクト: aartika/big-data
 public void readFields(DataInput dataInput) throws IOException {
   this.productId1 = Text.readString(dataInput);
   this.productId2 = Text.readString(dataInput);
 }
コード例 #20
0
 @Override
 public void readFields(DataInput in) throws IOException {
   queueName = StringInterner.weakIntern(Text.readString(in));
   operations = WritableUtils.readStringArray(in);
 }
コード例 #21
0
 public void readFields(DataInput in) throws IOException {
   this.offset = in.readLong();
   this.fileName = Text.readString(in);
 }
コード例 #22
0
 public void readFields(DataInput in) throws IOException {
   this.url = Text.readString(in);
   this.referrer = Text.readString(in);
   this.time = in.readLong();
 }
コード例 #23
0
 @Override
 public void readFields(DataInput in) throws IOException {
   super.readFields(in);
   splitClass = Text.readString(in);
   split.readFields(in);
 }
コード例 #24
0
ファイル: PairOfLongString.java プロジェクト: imoldcat/Cloud9
 /**
  * Deserializes the pair.
  *
  * @param in source for raw byte representation
  */
 public void readFields(DataInput in) throws IOException {
   leftElement = in.readLong();
   rightElement = Text.readString(in);
 }
コード例 #25
0
ファイル: DistCp.java プロジェクト: neutronsharc/hdfsbackup
 public void readFields(DataInput in) throws IOException {
   input.readFields(in);
   output = Text.readString(in);
 }
コード例 #26
0
 @Override
 public void readFields(DataInput in) throws IOException {
   trackerName = Text.readString(in);
   reasonForBlackListing = Text.readString(in);
   blackListReport = Text.readString(in);
 }
コード例 #27
0
ファイル: JobID.java プロジェクト: NikkitaSh30/i-mapreduce
 @Override
 public void readFields(DataInput in) throws IOException {
   super.readFields(in);
   this.jtIdentifier = Text.readString(in);
 }
コード例 #28
0
 /** {@inheritDoc} */
 public void readFields(DataInput in) throws IOException {
   username = Text.readString(in);
   groupname = Text.readString(in);
   permission = FsPermission.read(in);
 }
コード例 #29
0
 public void readFields(DataInput in) throws IOException {
   queryString = Text.readString(in);
   from = in.readLong();
   size = in.readLong();
 }