Beispiel #1
0
  protected boolean shouldProcessRecord(String collection, BSONTimestamp timestamp) {
    boolean shouldProcess = false;

    if (COLLECTIONS_TO_ADD.contains(collection)) {
      shouldProcess = true;
    }
    if (COLLECTIONS_TO_SKIP.contains(collection)) {
      shouldProcess = false;
    } else {
      if (ONLY_COLLECTION_EXCLUSIONS) {
        shouldProcess = true;
      }
    }
    if (AFTER_TIMESTAMP != null) {
      if (timestamp.getTime() < AFTER_TIMESTAMP.getTime()) {
        shouldProcess = false;
      }
    }
    if (BEFORE_TIMESTAMP != null) {
      if (timestamp.getTime() >= BEFORE_TIMESTAMP.getTime()) {
        shouldProcess = false;
      }
    }
    return shouldProcess;
  }
Beispiel #2
0
 public void writeBSONTimestamp(BSONTimestamp timestamp) throws IOException {
   _writeArrayFieldNameIfNeeded();
   _verifyValueWrite("write timestamp");
   _buffer.putByte(_typeMarker, BsonConstants.TYPE_TIMESTAMP);
   _buffer.putInt(timestamp.getInc());
   _buffer.putInt(timestamp.getTime());
   flushBuffer();
 }
 protected void putTimestamp(String name, BSONTimestamp ts) {
   _put(TIMESTAMP, name);
   _buf.writeInt(ts.getInc());
   _buf.writeInt(ts.getTime());
 }