public ClientTracker(SnappyDataServiceImpl service, String clientHostId) { this.service = service; this.clientHostId = clientHostId; this.connectionIds = new TLongHashSet(8); this.clientSockets = new THashSet(8); }
public void cmnCrfCreate(long oplogId) { this.crfIds.add(oplogId); this.ifLiveRecordCount++; this.ifTotalRecordCount++; } public void cmnDrfCreate(long oplogId) {
public final boolean execute(long value) { return that.contains(value); } });
private TLongHashSet calcMissing(TLongHashSet found, TLongHashSet expected) { TLongHashSet missing = new TLongHashSet(expected.toArray()); missing.removeAll(found.toArray()); return missing; }
/** * Compares this set with another set for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @Override // GemStoneAddition public boolean equals(Object other) { if (! (other instanceof TLongHashSet)) { return false; } final TLongHashSet that = (TLongHashSet)other; if (that.size() != this.size()) { return false; } return forEach(new TLongProcedure() { public final boolean execute(long value) { return that.contains(value); } }); }
TLongHashSet cdlUniq = new TLongHashSet(); ArrayList<ConglomerateDescriptor> cdl = new ArrayList<ConglomerateDescriptor>(); continue; else if (cdlUniq.contains(cdNum)) { continue; this.hasGlobalIndexOrCallbacks = true; cdlUniq.add(cdNum);
public boolean cmnDrfDelete(long oplogId) { if (this.drfIds.remove(oplogId)) { this.ifLiveRecordCount--; this.ifTotalRecordCount++; return true; } else { return false; } }
/** * Empties the set. */ @Override // GemStoneAddition public void clear() { this._set.clear(); }
if (_set.equals(other)) { return true; // comparing two trove sets } else if (other instanceof Set) { Set that = (Set)other; if (that.size() != _set.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way if (val instanceof Long) { long v = unwrap(val); if (_set.contains(v)) {
/** * Creates an iterator over the values of the set. * * @return an iterator with support for removals in the underlying set */ @Override // GemStoneAddition public Iterator iterator() { return new Iterator() { private final TLongIterator it = _set.iterator(); public Object next() { return wrap(it.next()); } public boolean hasNext() { return it.hasNext(); } public void remove() { it.remove(); } }; }
public void verifyOplogs(TLongHashSet foundCrfs, TLongHashSet foundDrfs, TLongHashSet expectedCrfIds, TLongHashSet expectedDrfIds) { TLongHashSet missingCrfs = calcMissing(foundCrfs, expectedCrfIds); TLongHashSet missingDrfs = calcMissing(foundDrfs, expectedDrfIds); // Note that finding extra ones is ok; it is possible we died just // after creating one but before we could record it in the if file // Or died just after deleting it but before we could record it in the if file. boolean failed = false; String msg = null; if (!missingCrfs.isEmpty()) { failed = true; msg = "*.crf files with these ids: " + Arrays.toString(missingCrfs.toArray()); } if (!missingDrfs.isEmpty()) { failed = true; if (msg == null) { msg = ""; } else { msg += ", "; } msg += "*.drf files with these ids: " + Arrays.toString(missingDrfs.toArray()); } if (failed) { msg = "The following required files could not be found: " + msg + "."; throw new IllegalStateException(msg); } }
/** * Returns the number of entries in the set. * @return the set's size. */ @Override // GemStoneAddition public int size() { return this._set.size(); }
private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); // number of entries stream.writeInt(_size); SerializationProcedure writeProcedure = new SerializationProcedure(stream); if (! forEach(writeProcedure)) { throw writeProcedure.exception; } }
if (this.connectionIds.isEmpty()) {
TLongHashSet cdlUniq = new TLongHashSet(); ArrayList<ConglomerateDescriptor> cdl = new ArrayList<ConglomerateDescriptor>(); continue; else if (cdlUniq.contains(cdNum)) { continue; this.hasGlobalIndexOrCallbacks = true; cdlUniq.add(cdNum);
public void cmnIrfDelete(long oplogId) { this.irfIds.remove(oplogId); this.ifLiveRecordCount++; this.ifTotalRecordCount++; } public void cmnIndexCreate(String indexId) {