本文整理汇总了Java中org.apache.hadoop.io.DataInputByteBuffer.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java DataInputByteBuffer.readInt方法的具体用法?Java DataInputByteBuffer.readInt怎么用?Java DataInputByteBuffer.readInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.io.DataInputByteBuffer
的用法示例。
在下文中一共展示了DataInputByteBuffer.readInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserializeMetaData
import org.apache.hadoop.io.DataInputByteBuffer; //导入方法依赖的package包/类
/**
* A helper function to deserialize the metadata returned by ShuffleHandler.
* @param meta the metadata returned by the ShuffleHandler
* @return the port the Shuffle Handler is listening on to serve shuffle data.
*/
public static int deserializeMetaData(ByteBuffer meta) throws IOException {
//TODO this should be returning a class not just an int
DataInputByteBuffer in = new DataInputByteBuffer();
in.reset(meta);
int port = in.readInt();
return port;
}
示例2: deserializeMetaData
import org.apache.hadoop.io.DataInputByteBuffer; //导入方法依赖的package包/类
/**
* A helper function to deserialize the metadata returned by PullServerAuxService.
* @param meta the metadata returned by the PullServerAuxService
* @return the port the PullServer Handler is listening on to serve shuffle data.
*/
public static int deserializeMetaData(ByteBuffer meta) throws IOException {
//TODO this should be returning a class not just an int
DataInputByteBuffer in = new DataInputByteBuffer();
in.reset(meta);
return in.readInt();
}
示例3: deserializeShuffleProviderMetaData
import org.apache.hadoop.io.DataInputByteBuffer; //导入方法依赖的package包/类
public static int deserializeShuffleProviderMetaData(ByteBuffer meta)
throws IOException {
DataInputByteBuffer in = new DataInputByteBuffer();
try {
in.reset(meta);
int port = in.readInt();
return port;
} finally {
in.close();
}
}
示例4: launch
import org.apache.hadoop.io.DataInputByteBuffer; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public synchronized void launch(ContainerLaunchRequest event) {
LOG.info("Launching " + event.getContainerId());
if(this.state == ContainerState.KILLED_BEFORE_LAUNCH) {
state = ContainerState.DONE;
sendContainerLaunchFailedMsg(event.getContainerId(),
"Container was killed before it was launched");
return;
}
ContainerManagementProtocolProxyData proxy = null;
try {
proxy = getCMProxy(containerID, containerMgrAddress,
containerToken);
// Construct the actual Container
ContainerLaunchContext containerLaunchContext =
event.getContainerLaunchContext();
// Now launch the actual container
StartContainerRequest startRequest = Records
.newRecord(StartContainerRequest.class);
startRequest.setContainerToken(event.getContainerToken());
startRequest.setContainerLaunchContext(containerLaunchContext);
StartContainersResponse response =
proxy.getContainerManagementProtocol().startContainers(
StartContainersRequest.newInstance(
Collections.singletonList(startRequest)));
if (response.getFailedRequests() != null
&& !response.getFailedRequests().isEmpty()) {
throw response.getFailedRequests().get(containerID).deSerialize();
}
// after launching, send launched event to task attempt to move
// it from ASSIGNED to RUNNING state
getContext().containerLaunched(containerID);
this.state = ContainerState.RUNNING;
int shufflePort = TezRuntimeUtils.INVALID_PORT;
Map<String, java.nio.ByteBuffer> servicesMetaData = response.getAllServicesMetaData();
if (servicesMetaData != null) {
String auxiliaryService = conf.get(TezConfiguration.TEZ_AM_SHUFFLE_AUXILIARY_SERVICE_ID,
TezConfiguration.TEZ_AM_SHUFFLE_AUXILIARY_SERVICE_ID_DEFAULT);
ByteBuffer portInfo = servicesMetaData.get(auxiliaryService);
if (portInfo != null) {
DataInputByteBuffer in = new DataInputByteBuffer();
in.reset(portInfo);
shufflePort = in.readInt();
} else {
LOG.warn("Shuffle port for {} is not present is the services metadata response", auxiliaryService);
}
} else {
LOG.warn("Shuffle port cannot be found since services metadata response is missing");
}
if (deletionTracker != null) {
deletionTracker.addNodeShufflePort(event.getNodeId(), shufflePort);
}
} catch (Throwable t) {
String message = "Container launch failed for " + containerID + " : "
+ ExceptionUtils.getStackTrace(t);
this.state = ContainerState.FAILED;
sendContainerLaunchFailedMsg(containerID, message);
} finally {
if (proxy != null) {
cmProxy.mayBeCloseProxy(proxy);
}
}
}