/** {@inheritDoc} */ @Override public void close() throws IOException { if (closed) return; try { if (!locks.remove(lockName)) throw new AlreadyClosedException("Lock was already released: " + this); } finally { closed = true; } }
/** {@inheritDoc} */ @Override public boolean onDone(@Nullable Void res, @Nullable Throwable err) { if (super.onDone(res, err)) { dataStreamerFuts.remove(this); return true; } return false; }
/** * Removes stale references. */ private void removeStale() { PhantomReferenceElement<E> ref; while ((ref = (PhantomReferenceElement<E>) refQ.poll()) != null) { store.remove(ref); onGc(ref.get()); } }
/** * Removes stale references. */ private void removeStale() { WeakReferenceElement<E> ref; while ((ref = (WeakReferenceElement<E>) gcQ.poll()) != null) { store.remove(ref); onGc(ref.get()); } }
/** {@inheritDoc} */ @Override public int read(ByteBuffer destBuf, long position) throws IOException { ChannelOpFuture fut = holder.get(); fut.reset(); ch.read(destBuf, position, null, fut); try { return fut.getUninterruptibly(); } catch (IgniteCheckedException e) { throw new IOException(e); } finally { asyncFuts.remove(fut); } }
/** {@inheritDoc} */ @Override public int write(ByteBuffer srcBuf, long position) throws IOException { ChannelOpFuture fut = holder.get(); fut.reset(); asyncFuts.add(fut); ch.write(srcBuf, position, null, fut); try { return fut.getUninterruptibly(); } catch (IgniteCheckedException e) { throw new IOException(e); } finally { asyncFuts.remove(fut); } }
@Override public Void call() throws Exception { while (!stopped.get()) { Ignite node = grid(ThreadLocalRandom.current().nextInt(1, 5)); IgniteInternalFuture fut; int fieldNum = ThreadLocalRandom.current().nextInt(0, dynColCnt.get() + 1); boolean removed = fields.remove(fieldNum); if (removed) fut = dropCols(node, QueryUtils.DFLT_SCHEMA, "newCol" + fieldNum); else { fieldNum = dynColCnt.getAndIncrement(); fut = addCols(node, QueryUtils.DFLT_SCHEMA, c("newCol" + fieldNum, Integer.class.getName())); } try { fut.get(); if (!removed) fields.add(fieldNum); } catch (SchemaOperationException e) { // No-op. } catch (Exception e) { fail("Unexpected exception: " + e); } } return null; } }, 1);
@Override public Void call() throws Exception { while (!stopped.get()) { Ignite node = grid(ThreadLocalRandom.current().nextInt(1, 5)); IgniteInternalFuture fut; int fieldNum = ThreadLocalRandom.current().nextInt(0, dynColCnt.get() + 1); boolean removed = fields.remove(fieldNum); if (removed) fut = dropCols(node, QueryUtils.DFLT_SCHEMA, "newCol" + fieldNum); else { fieldNum = dynColCnt.getAndIncrement(); fut = addCols(node, QueryUtils.DFLT_SCHEMA, c("newCol" + fieldNum, Integer.class.getName())); } try { fut.get(); if (!removed) fields.add(fieldNum); } catch (SchemaOperationException e) { // No-op. } catch (Exception e) { fail("Unexpected exception: " + e); } } return null; } }, 1);
evts.remove(foundEvt);
/** {@inheritDoc} */ @Override public void close() throws IOException { if (closed) return; try { if (!locks.remove(lockName)) throw new AlreadyClosedException("Lock was already released: " + this); } finally { closed = true; } }
/** {@inheritDoc} */ @Override public boolean onDone(@Nullable Void res, @Nullable Throwable err) { if (super.onDone(res, err)) { dataStreamerFuts.remove(this); return true; } return false; }
/** * Removes stale references. */ private void removeStale() { WeakReferenceElement<E> ref; while ((ref = (WeakReferenceElement<E>) gcQ.poll()) != null) { store.remove(ref); onGc(ref.get()); } }
/** * Removes stale references. */ private void removeStale() { PhantomReferenceElement<E> ref; while ((ref = (PhantomReferenceElement<E>) refQ.poll()) != null) { store.remove(ref); onGc(ref.get()); } }
/** {@inheritDoc} */ @Override public int read(ByteBuffer destBuf, long position) throws IOException { ChannelOpFuture fut = holder.get(); fut.reset(); ch.read(destBuf, position, null, fut); try { return fut.getUninterruptibly(); } catch (IgniteCheckedException e) { throw new IOException(e); } finally { asyncFuts.remove(fut); } }
/** {@inheritDoc} */ @Override public int write(ByteBuffer srcBuf, long position) throws IOException { ChannelOpFuture fut = holder.get(); fut.reset(); asyncFuts.add(fut); ch.write(srcBuf, position, null, fut); try { return fut.getUninterruptibly(); } catch (IgniteCheckedException e) { throw new IOException(e); } finally { asyncFuts.remove(fut); } }