Package org.commoncrawl.async

Examples of org.commoncrawl.async.Timer


  @SuppressWarnings("unchecked")
  public <DataType extends RPCStruct,KeyType extends WritableComparable,ValueType extends Writable> BlockingQueryResult<KeyType,ValueType> blockingQueryRequest(final Query<DataType,KeyType,ValueType> queryObject,final ClientQueryInfo queryInfo) throws IOException {
   
    final LinkedBlockingQueue<BlockingQueryResult<KeyType,ValueType>> queue = new LinkedBlockingQueue<BlockingQueryResult<KeyType,ValueType>>(1);
   
    _host.getEventLoop().setTimer(new Timer(0,false,new Timer.Callback() {

      @Override
      public void timerFired(Timer timer) {
        try {
          queueClientQueryRequest(queryObject,queryInfo,new QueryCompletionCallback<DataType,KeyType, ValueType>() {
View Full Code Here


   
    Thread eventThread = (_ownsEventLoop) ? _eventLoop.getEventThread() : null;
   
    final Semaphore shutdownSemaphore = new Semaphore(0);
   
    _eventLoop.setTimer(new Timer(1,false,new Timer.Callback() {

      // shutdown within the context of the async thread ...
      public void timerFired(Timer timer) {
     
        try {
View Full Code Here

    int itemId = -1;
    synchronized (_queuedItems) {
      itemId = ++_lastItemId;
      _queuedItems.addLast(new S3DownloadItem(itemKey,itemId));
    }
    _eventLoop.setTimer(new Timer(1,false,new Timer.Callback() {

      public void timerFired(Timer timer) {
        // executes in the context of the event loop thread ...
        downloadNextItem();
      }
View Full Code Here

   
    synchronized (_queuedItems) {
      itemId = ++_lastItemId;
      _queuedItems.addLast(downloadItem);
    }
    _eventLoop.setTimer(new Timer(1,false,new Timer.Callback() {

      public void timerFired(Timer timer) {
        // executes in the context of the event loop thread ...
        downloadNextItem();
      }
View Full Code Here

      protected void done() {

        // completionQueue.add(this);
        // wake the event loop up ...
        // eventLoop.wakeup();
        eventLoop.setTimer(new Timer(0, false, new Timer.Callback() {

          @Override
          public void timerFired(Timer timer) {

            if (!isCancelled()) {
View Full Code Here

TOP

Related Classes of org.commoncrawl.async.Timer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.