scala.concurrent.Promise.isCompleted()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(276)

本文整理了Java中scala.concurrent.Promise.isCompleted()方法的一些代码示例,展示了Promise.isCompleted()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Promise.isCompleted()方法的具体详情如下:
包路径:scala.concurrent.Promise
类名称:Promise
方法名:isCompleted

Promise.isCompleted介绍

暂无

代码示例

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

private void completePromise(ActorGateway gateway) {
  synchronized (lock) {
    if (!futureActorGateway.isCompleted()) {
      futureActorGateway.success(gateway);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

@Override
  public void handleError(Exception exception) {
    if (!connectionInfo.isCompleted()) {
      connectionInfo.failure(exception);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

@Override
  public void handleError(Exception exception) {
    if (!connectionInfo.isCompleted()) {
      connectionInfo.failure(exception);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime

private void completePromise(ActorGateway gateway) {
  synchronized (lock) {
    if (!futureActorGateway.isCompleted()) {
      futureActorGateway.success(gateway);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

@Override
public void handleError(Exception exception) {
  if (!futureActorGateway.isCompleted()) {
    futureActorGateway.failure(exception);
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

private void completePromise(ActorGateway gateway) {
  synchronized (lock) {
    if (!futureActorGateway.isCompleted()) {
      futureActorGateway.success(gateway);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

@Override
public void handleError(Exception exception) {
  if (!futureActorGateway.isCompleted()) {
    futureActorGateway.failure(exception);
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime

@Override
public void handleError(Exception exception) {
  if (!futureActorGateway.isCompleted()) {
    futureActorGateway.failure(exception);
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime

@Override
  public void handleError(Exception exception) {
    if (!connectionInfo.isCompleted()) {
      connectionInfo.failure(exception);
    }
  }
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

private void completePromise(ActorGateway gateway) {
  synchronized (lock) {
    if (!futureActorGateway.isCompleted()) {
      futureActorGateway.success(gateway);
    }
  }
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

@Override
public void handleError(Exception exception) {
  if (!futureActorGateway.isCompleted()) {
    futureActorGateway.failure(exception);
  }
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

@Override
  public void handleError(Exception exception) {
    if (!connectionInfo.isCompleted()) {
      connectionInfo.failure(exception);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

@Override
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID) {
  if(leaderAddress != null && !leaderAddress.equals("") && !connectionInfo.isCompleted()) {
    connectionInfo.success(new LeaderConnectionInfo(leaderAddress, leaderSessionID));
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

@Override
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID) {
  if (leaderAddress != null && !leaderAddress.equals("") && !connectionInfo.isCompleted()) {
    try {
      final LeaderConnectionInfo leaderConnectionInfo = new LeaderConnectionInfo(leaderAddress, leaderSessionID);
      connectionInfo.success(leaderConnectionInfo);
    } catch (FlinkException e) {
      connectionInfo.failure(e);
    }
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime

@Override
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID) {
  if (leaderAddress != null && !leaderAddress.equals("") && !connectionInfo.isCompleted()) {
    try {
      final LeaderConnectionInfo leaderConnectionInfo = new LeaderConnectionInfo(leaderAddress, leaderSessionID);
      connectionInfo.success(leaderConnectionInfo);
    } catch (FlinkException e) {
      connectionInfo.failure(e);
    }
  }
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

@Override
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID) {
  if (leaderAddress != null && !leaderAddress.equals("") && !connectionInfo.isCompleted()) {
    try {
      final LeaderConnectionInfo leaderConnectionInfo = new LeaderConnectionInfo(leaderAddress, leaderSessionID);
      connectionInfo.success(leaderConnectionInfo);
    } catch (FlinkException e) {
      connectionInfo.failure(e);
    }
  }
}

代码示例来源:origin: com.twitter/scalding-core

public void onCompleted(Flow f) {
 // This is always called, but onThrowable is called first
 if(!result.isCompleted()) {
  // we use the above rather than trySuccess to avoid calling fn twice
  try {
   T toPut = (T) fn.apply(f);
   result.success(toPut);
  }
  catch(Throwable t) {
   result.failure(t);
  }
 }
}
public boolean onThrowable(Flow f, Throwable t) {

代码示例来源:origin: com.twitter/scalding-core_2.10

public void onCompleted(Flow f) {
 // This is always called, but onThrowable is called first
 if(!result.isCompleted()) {
  // we use the above rather than trySuccess to avoid calling fn twice
  try {
   T toPut = (T) fn.apply(f);
   result.success(toPut);
  }
  catch(Throwable t) {
   result.failure(t);
  }
 }
}
public boolean onThrowable(Flow f, Throwable t) {

代码示例来源:origin: com.alibaba.blink/flink-runtime

@Override
public void notifyLeaderAddress(final String leaderAddress, final UUID leaderSessionID) {
  if(leaderAddress != null && !leaderAddress.equals("") && !futureActorGateway.isCompleted()) {
    AkkaUtils.getActorRefFuture(leaderAddress, actorSystem, timeout)
      .map(new Mapper<ActorRef, ActorGateway>() {
        public ActorGateway apply(ActorRef ref) {
          return new AkkaActorGateway(ref, leaderSessionID);
        }
      }, actorSystem.dispatcher())
      .onComplete(new OnComplete<ActorGateway>() {
        @Override
        public void onComplete(Throwable failure, ActorGateway success) throws Throwable {
          if (failure == null) {
            completePromise(success);
          } else {
            LOG.debug("Could not retrieve the leader for address " + leaderAddress + ".", failure);
          }
        }
      }, actorSystem.dispatcher());
  }
}

代码示例来源:origin: org.apache.flink/flink-runtime

@Override
public void notifyLeaderAddress(final String leaderAddress, final UUID leaderSessionID) {
  if(leaderAddress != null && !leaderAddress.equals("") && !futureActorGateway.isCompleted()) {
    AkkaUtils.getActorRefFuture(leaderAddress, actorSystem, timeout)
      .map(new Mapper<ActorRef, ActorGateway>() {
        public ActorGateway apply(ActorRef ref) {
          return new AkkaActorGateway(ref, leaderSessionID);
        }
      }, actorSystem.dispatcher())
      .onComplete(new OnComplete<ActorGateway>() {
        @Override
        public void onComplete(Throwable failure, ActorGateway success) throws Throwable {
          if (failure == null) {
            completePromise(success);
          } else {
            LOG.debug("Could not retrieve the leader for address " + leaderAddress + ".", failure);
          }
        }
      }, actorSystem.dispatcher());
  }
}

相关文章