当前位置: 首页>>代码示例>>Java>>正文


Java Address.equals方法代码示例

本文整理汇总了Java中com.hazelcast.nio.Address.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Address.equals方法的具体用法?Java Address.equals怎么用?Java Address.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hazelcast.nio.Address的用法示例。


在下文中一共展示了Address.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import com.hazelcast.nio.Address; //导入方法依赖的package包/类
@Override
public void run() throws Exception {
    ILogger logger = getLogger();
    JetService service = getService();

    Address callerAddress = getCallerAddress();
    logger.fine("Completing execution " + idToString(executionId) + " from caller: " + callerAddress
            + " with " + error);

    Address masterAddress = getNodeEngine().getMasterAddress();
    if (!callerAddress.equals(masterAddress)) {
        throw new IllegalStateException("Caller " + callerAddress + " cannot complete execution of "
                + idToString(executionId) + " because it is not master. Master is: " + masterAddress);
    }

    service.getJobExecutionService().completeExecution(executionId, error);
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:18,代码来源:CompleteExecutionOperation.java

示例2: assertExecutionContext

import com.hazelcast.nio.Address; //导入方法依赖的package包/类
public ExecutionContext assertExecutionContext(Address coordinator, long jobId, long executionId,
                                               Operation callerOp) {
    Address masterAddress = nodeEngine.getMasterAddress();
    if (!coordinator.equals(masterAddress)) {
        failIfNotRunning();

        throw new IllegalStateException(String.format(
                "Coordinator %s cannot do '%s' for %s: it is not the master, the master is %s",
                coordinator, callerOp.getClass().getSimpleName(),
                jobAndExecutionId(jobId, executionId), masterAddress));
    }

    failIfNotRunning();

    ExecutionContext executionContext = executionContexts.get(executionId);
    if (executionContext == null) {
        throw new TopologyChangedException(String.format(
                "%s not found for coordinator %s for '%s'",
                jobAndExecutionId(jobId, executionId), coordinator, callerOp.getClass().getSimpleName()));
    } else if (!(executionContext.coordinator().equals(coordinator) && executionContext.jobId() == jobId)) {
        throw new IllegalStateException(String.format(
                "%s, originally from coordinator %s, cannot do '%s' by coordinator %s and execution %s",
                jobAndExecutionId(jobId, executionContext.executionId()), executionContext.coordinator(),
                callerOp.getClass().getSimpleName(), coordinator, idToString(executionId)));
    }

    return executionContext;
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:29,代码来源:JobExecutionService.java


注:本文中的com.hazelcast.nio.Address.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。