本文整理汇总了Java中org.apache.helix.messaging.handling.HelixTaskResult类的典型用法代码示例。如果您正苦于以下问题:Java HelixTaskResult类的具体用法?Java HelixTaskResult怎么用?Java HelixTaskResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HelixTaskResult类属于org.apache.helix.messaging.handling包,在下文中一共展示了HelixTaskResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
String messageSubType = this._message.getMsgSubType();
if (messageSubType.equalsIgnoreCase(HelixMessageSubTypes.TOKEN_FILE_UPDATED.toString())) {
LOGGER.info("Handling message " + HelixMessageSubTypes.TOKEN_FILE_UPDATED.toString());
eventBus.post(new DelegationTokenUpdatedEvent());
HelixTaskResult helixTaskResult = new HelixTaskResult();
helixTaskResult.setSuccess(true);
return helixTaskResult;
}
throw new IllegalArgumentException(String.format("Unknown %s message subtype: %s",
Message.MessageType.USER_DEFINE_MSG.toString(), messageSubType));
}
开发者ID:Hanmourang,项目名称:Gobblin,代码行数:17,代码来源:GobblinApplicationMaster.java
示例2: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
String messageSubType = this._message.getMsgSubType();
if (messageSubType.equalsIgnoreCase(org.apache.gobblin.cluster.HelixMessageSubTypes.TOKEN_FILE_UPDATED.toString())) {
LOGGER.info("Handling message " + org.apache.gobblin.cluster.HelixMessageSubTypes.TOKEN_FILE_UPDATED.toString());
eventBus.post(new DelegationTokenUpdatedEvent());
HelixTaskResult helixTaskResult = new HelixTaskResult();
helixTaskResult.setSuccess(true);
return helixTaskResult;
}
throw new IllegalArgumentException(String
.format("Unknown %s message subtype: %s", Message.MessageType.USER_DEFINE_MSG.toString(), messageSubType));
}
开发者ID:apache,项目名称:incubator-gobblin,代码行数:17,代码来源:GobblinYarnTaskRunner.java
示例3: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
String hostName;
HelixTaskResult result = new HelixTaskResult();
try {
hostName = InetAddress.getLocalHost().getCanonicalHostName();
} catch (UnknownHostException e) {
hostName = "UNKNOWN";
}
String port = "2134";
String msgSubType = _message.getMsgSubType();
if (msgSubType.equals(REQUEST_BOOTSTRAP_URL)) {
result.getTaskResultMap().put(
"BOOTSTRAP_URL",
"http://" + hostName + ":" + port + "/getFile?path=/data/bootstrap/"
+ _message.getResourceName() + "/" + _message.getPartitionName() + ".tar");
result.getTaskResultMap().put("BOOTSTRAP_TIME", "" + new Date().getTime());
}
result.setSuccess(true);
return result;
}
开发者ID:apache,项目名称:helix,代码行数:24,代码来源:BootstrapProcess.java
示例4: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
_latch.await();
HelixTaskResult result = new HelixTaskResult();
result.setSuccess(true);
result.getTaskResultMap().put("Message", _message.getMsgId());
String destName = _message.getTgtName();
synchronized (_results) {
if (!_results.containsKey(_message.getPartitionName())) {
_results.put(_message.getPartitionName(), new ConcurrentSkipListSet<String>());
}
}
_results.get(_message.getPartitionName()).add(destName);
// System.err.println("Message " + _message.getMsgId() + " executed");
return result;
}
开发者ID:apache,项目名称:helix,代码行数:17,代码来源:TestSchedulerMessage.java
示例5: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
HelixTaskResult helixTaskResult = new HelixTaskResult();
_logger.info("Handling message: {}", _message);
try {
if (_segmentName.equals("")) {
acquireSema("ALL", _logger);
_instanceDataManager.reloadAllSegments(_tableNameWithType);
} else {
// Reload one segment
acquireSema(_segmentName, _logger);
_instanceDataManager.reloadSegment(_tableNameWithType, _segmentName);
}
helixTaskResult.setSuccess(true);
} catch (Exception e) {
throw new RuntimeException(
"Caught exception while reloading segment: " + _segmentName + " in table: " + _tableNameWithType, e);
} finally {
releaseSema();
}
return helixTaskResult;
}
开发者ID:linkedin,项目名称:pinot,代码行数:23,代码来源:SegmentMessageHandlerFactory.java
示例6: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
LOGGER.warn(String
.format("No handling setup for %s message of subtype: %s", Message.MessageType.USER_DEFINE_MSG.toString(),
this._message.getMsgSubType()));
final HelixTaskResult helixTaskResult = new HelixTaskResult();
helixTaskResult.setSuccess(true);
return helixTaskResult;
}
开发者ID:apache,项目名称:incubator-gobblin,代码行数:11,代码来源:GobblinAWSClusterManager.java
示例7: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
LOGGER.warn(String
.format("No handling setup for %s message of subtype: %s", Message.MessageType.USER_DEFINE_MSG.toString(),
this._message.getMsgSubType()));
HelixTaskResult helixTaskResult = new HelixTaskResult();
helixTaskResult.setSuccess(true);
return helixTaskResult;
}
开发者ID:apache,项目名称:incubator-gobblin,代码行数:11,代码来源:GobblinClusterManager.java
示例8: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage()
throws InterruptedException {
logger.warn(String.format("No handling setup for %s message of subtype: %s",
Message.MessageType.USER_DEFINE_MSG.toString(), this._message.getMsgSubType()));
HelixTaskResult helixTaskResult = new HelixTaskResult();
helixTaskResult.setSuccess(true);
return helixTaskResult;
}
开发者ID:apache,项目名称:incubator-gobblin,代码行数:11,代码来源:GobblinTaskRunner.java
示例9: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage()
throws InterruptedException {
// Delay handling the message so the ZooKeeper client sees the message
Thread.sleep(1000);
this.helixMessageTestBase.assertMessageReception(_message);
HelixTaskResult result = new HelixTaskResult();
result.setSuccess(true);
return result;
}
开发者ID:apache,项目名称:incubator-gobblin,代码行数:11,代码来源:TestShutdownMessageHandlerFactory.java
示例10: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
String type = _message.getMsgType();
HelixTaskResult result = new HelixTaskResult();
if (!type.equals(MessageType.CONTROLLER_MSG.name())) {
throw new HelixException("Unexpected msg type for message " + _message.getMsgId()
+ " type:" + _message.getMsgType());
}
result.getTaskResultMap().put("ControllerResult",
"msg " + _message.getMsgId() + " from " + _message.getMsgSrc() + " processed");
result.setSuccess(true);
return result;
}
开发者ID:apache,项目名称:helix,代码行数:14,代码来源:DefaultControllerMessageHandlerFactory.java
示例11: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
HelixTaskResult result = new HelixTaskResult();
result.setSuccess(true);
// TODO : consider unify this with StatsAggregationStage.executeAlertActions()
try {
ActionOnError actionOnError =
ActionOnError.valueOf(_message.getRecord().getSimpleField(ACTIONKEY));
if (actionOnError == ActionOnError.DISABLE_INSTANCE) {
_manager.getClusterManagmentTool().enableInstance(_manager.getClusterName(),
_message.getMsgSrc(), false);
_logger.info("Instance " + _message.getMsgSrc() + " disabled");
} else if (actionOnError == ActionOnError.DISABLE_PARTITION) {
_manager.getClusterManagmentTool().enablePartition(false, _manager.getClusterName(),
_message.getMsgSrc(), _message.getResourceName(),
Arrays.asList(_message.getPartitionName()));
_logger.info("partition " + _message.getPartitionName() + " disabled");
} else if (actionOnError == ActionOnError.DISABLE_RESOURCE) {
// NOT IMPLEMENTED, or we can disable all partitions
// _manager.getClusterManagmentTool().en(_manager.getClusterName(),
// _manager.getInstanceName(),
// _message.getResourceName(), _message.getPartitionName(), false);
_logger.info("resource " + _message.getResourceName() + " disabled");
}
} catch (Exception e) {
_logger.error("", e);
result.setSuccess(false);
result.setException(e);
}
return result;
}
开发者ID:apache,项目名称:helix,代码行数:33,代码来源:DefaultParticipantErrorMessageHandlerFactory.java
示例12: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
_handledMsgSet.add(_message.getId());
HelixTaskResult ret = new HelixTaskResult();
ret.setSuccess(true);
return ret;
}
开发者ID:apache,项目名称:helix,代码行数:8,代码来源:TestZkSessionExpiry.java
示例13: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
HelixTaskResult result = new HelixTaskResult();
result.setSuccess(true);
Thread.sleep(1000);
System.out.println("TestMessagingHandler " + _message.getMsgId());
_processedMsgIds.add(_message.getRecord().getSimpleField("TestMessagingPara"));
result.getTaskResultMap().put("ReplyMessage", "TestReplyMessage");
return result;
}
开发者ID:apache,项目名称:helix,代码行数:11,代码来源:TestMessagingService.java
示例14: isDone
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
public boolean isDone(String taskId) {
Future<HelixTaskResult> future = _taskMap.get(taskId).getFuture();
if (future != null) {
return future.isDone();
}
return false;
}
开发者ID:apache,项目名称:helix,代码行数:8,代码来源:MockHelixTaskExecutor.java
示例15: handleMessage
import org.apache.helix.messaging.handling.HelixTaskResult; //导入依赖的package包/类
@Override
public HelixTaskResult handleMessage() throws InterruptedException {
HelixTaskResult result = new HelixTaskResult();
result.setSuccess(true);
return result;
}
开发者ID:apache,项目名称:helix,代码行数:7,代码来源:TestDefaultMessagingService.java
注:本文中的org.apache.helix.messaging.handling.HelixTaskResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论