예제 #1
0
  /**
   * 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
 /** 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;
 }