コード例 #1
0
ファイル: RejoinProducer.java プロジェクト: rramdas/voltdb
  /**
   * An implementation of run() that does not block the site thread. The Site has responsibility for
   * transactions that occur between schedulings of this task.
   */
  @Override
  public void runForRejoin(SiteProcedureConnection siteConnection, TaskLog m_taskLog)
      throws IOException {
    RestoreWork rejoinWork = m_rejoinSiteProcessor.poll(m_snapshotBufferAllocator);
    if (rejoinWork != null) {
      restoreBlock(rejoinWork, siteConnection);
    }

    if (m_rejoinSiteProcessor.isEOF() == false) {
      m_taskQueue.offer(this);
    } else {
      REJOINLOG.debug(m_whoami + "Rejoin snapshot transfer is finished");
      m_rejoinSiteProcessor.close();

      Preconditions.checkNotNull(m_streamSnapshotMb);
      VoltDB.instance().getHostMessenger().removeMailbox(m_streamSnapshotMb.getHSId());

      doFinishingTask(siteConnection);
    }
  }
コード例 #2
0
 @Override
 public ImmutableList<E> subList(int fromIndex, int toIndex) {
   Preconditions.checkPositionIndexes(fromIndex, toIndex, 1);
   return (fromIndex == toIndex) ? ImmutableList.<E>of() : this;
 }
コード例 #3
0
 @Override
 public E get(int index) {
   Preconditions.checkElementIndex(index, 1);
   return element;
 }
コード例 #4
0
 protected SimpleForwardingLoadingCache(LoadingCache<K, V> delegate) {
   this.delegate = Preconditions.checkNotNull(delegate);
 }
コード例 #5
0
 public StreamSnapshotSink(Mailbox mb) {
   Preconditions.checkArgument(mb != null);
   m_mb = mb;
 }
コード例 #6
0
ファイル: LineReader.java プロジェクト: AsherBond/voltdb
 /** Creates a new instance that will read lines from the given {@code Readable} object. */
 public LineReader(Readable readable) {
   Preconditions.checkNotNull(readable);
   this.readable = readable;
   this.reader = (readable instanceof Reader) ? (Reader) readable : null;
 }