Ejemplo n.º 1
0
 @Override
 public void readFields(BufferReaderWriter reader) {
   run = reader.readString();
   queryid = reader.readInt();
   recall = reader.readDouble();
   precision = reader.readDouble();
 }
Ejemplo n.º 2
0
 public void read() {
   openRead();
   try {
     while (true) {
       ByteSearchSection section = reader.readSectionStart(root.section);
       if (section.notEmpty()) {
         section = root.readNode(section);
         reader.movePast(section);
       }
     }
   } catch (EOCException ex) {
   }
   closeRead();
 }
Ejemplo n.º 3
0
 public void openRead() {
   checkFirstUse();
   if (datafile != null) {
     if (reader == null) {
       reader = datafile.rwbuffer;
     }
     datafile.openRead();
     if (hasHeader) {
       ByteSearchSection section = reader.readSectionStart(root.section);
       if (section.notEmpty()) {
         root.readHeader(section);
         reader.movePast(section);
       }
     }
   }
 }
 /**
  * @param id
  * @return the offset in the datafile of the record(group) that contains the record with the given
  *     ID.
  */
 public long getOffset(int id) {
   long offset = -1;
   try {
     int marker = getMarkerOffset(id);
     int jumpindex = getJumpIndex(id);
     residenttable.setOffset(marker);
     offset = residenttable.readInt();
     for (int i = 0; i < jumpindex; i++) {
       offset += residenttable.readByte();
     }
     // log.info("getOffset() bucketindex %d marker %d jumpindex %d offset %d", bucketindex,
     // marker, jumpindex, offset);
   } catch (EOCException ex) {
     log.fatalexception(ex, "getOffset( %d ) residenttable %s", id, residenttable);
   }
   return offset;
 }
Ejemplo n.º 5
0
 public boolean nextRecord() {
   try {
     while (true) {
       ByteSearchSection section = reader.readSectionStart(root.section);
       if (validRecord(section)) {
         root.emptyDataContainer();
         section = root.readNode(section);
         reader.movePast(section);
         return true;
       }
       reader.movePast(section);
       if (!reader.hasMore()) {
         break;
       }
     }
   } catch (EOCException ex) {
   }
   root.emptyDataContainer();
   return false;
 }
Ejemplo n.º 6
0
 @Override
 public void readFields(BufferReaderWriter reader) {
   docid = reader.readString();
   creationtime = reader.readLong();
   isCandidate = reader.readBoolean();
 }