Java Code Examples for org.apache.hadoop.mapred.proto.ShuffleHandlerRecoveryProtos.JobShuffleInfoProto

The following examples show how to use org.apache.hadoop.mapred.proto.ShuffleHandlerRecoveryProtos.JobShuffleInfoProto. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hadoop   Source File: ShuffleHandler.java    License: Apache License 2.0 6 votes vote down vote up
private void recoverJobShuffleInfo(String jobIdStr, byte[] data)
    throws IOException {
  JobID jobId;
  try {
    jobId = JobID.forName(jobIdStr);
  } catch (IllegalArgumentException e) {
    throw new IOException("Bad job ID " + jobIdStr + " in state store", e);
  }

  JobShuffleInfoProto proto = JobShuffleInfoProto.parseFrom(data);
  String user = proto.getUser();
  TokenProto tokenProto = proto.getJobToken();
  Token<JobTokenIdentifier> jobToken = new Token<JobTokenIdentifier>(
      tokenProto.getIdentifier().toByteArray(),
      tokenProto.getPassword().toByteArray(),
      new Text(tokenProto.getKind()), new Text(tokenProto.getService()));
  addJobToken(jobId, user, jobToken);
}
 
Example 2
Source Project: hadoop   Source File: ShuffleHandler.java    License: Apache License 2.0 6 votes vote down vote up
private void recordJobShuffleInfo(JobID jobId, String user,
    Token<JobTokenIdentifier> jobToken) throws IOException {
  if (stateDb != null) {
    TokenProto tokenProto = TokenProto.newBuilder()
        .setIdentifier(ByteString.copyFrom(jobToken.getIdentifier()))
        .setPassword(ByteString.copyFrom(jobToken.getPassword()))
        .setKind(jobToken.getKind().toString())
        .setService(jobToken.getService().toString())
        .build();
    JobShuffleInfoProto proto = JobShuffleInfoProto.newBuilder()
        .setUser(user).setJobToken(tokenProto).build();
    try {
      stateDb.put(bytes(jobId.toString()), proto.toByteArray());
    } catch (DBException e) {
      throw new IOException("Error storing " + jobId, e);
    }
  }
  addJobToken(jobId, user, jobToken);
}
 
Example 3
Source Project: big-c   Source File: ShuffleHandler.java    License: Apache License 2.0 6 votes vote down vote up
private void recoverJobShuffleInfo(String jobIdStr, byte[] data)
    throws IOException {
  JobID jobId;
  try {
    jobId = JobID.forName(jobIdStr);
  } catch (IllegalArgumentException e) {
    throw new IOException("Bad job ID " + jobIdStr + " in state store", e);
  }

  JobShuffleInfoProto proto = JobShuffleInfoProto.parseFrom(data);
  String user = proto.getUser();
  TokenProto tokenProto = proto.getJobToken();
  Token<JobTokenIdentifier> jobToken = new Token<JobTokenIdentifier>(
      tokenProto.getIdentifier().toByteArray(),
      tokenProto.getPassword().toByteArray(),
      new Text(tokenProto.getKind()), new Text(tokenProto.getService()));
  addJobToken(jobId, user, jobToken);
}
 
Example 4
Source Project: big-c   Source File: ShuffleHandler.java    License: Apache License 2.0 6 votes vote down vote up
private void recordJobShuffleInfo(JobID jobId, String user,
    Token<JobTokenIdentifier> jobToken) throws IOException {
  if (stateDb != null) {
    TokenProto tokenProto = TokenProto.newBuilder()
        .setIdentifier(ByteString.copyFrom(jobToken.getIdentifier()))
        .setPassword(ByteString.copyFrom(jobToken.getPassword()))
        .setKind(jobToken.getKind().toString())
        .setService(jobToken.getService().toString())
        .build();
    JobShuffleInfoProto proto = JobShuffleInfoProto.newBuilder()
        .setUser(user).setJobToken(tokenProto).build();
    try {
      stateDb.put(bytes(jobId.toString()), proto.toByteArray());
    } catch (DBException e) {
      throw new IOException("Error storing " + jobId, e);
    }
  }
  addJobToken(jobId, user, jobToken);
}
 
Example 5
Source Project: tez   Source File: ShuffleHandler.java    License: Apache License 2.0 6 votes vote down vote up
private void recoverJobShuffleInfo(String jobIdStr, byte[] data)
    throws IOException {
  JobID jobId;
  try {
    jobId = JobID.forName(jobIdStr);
  } catch (IllegalArgumentException e) {
    throw new IOException("Bad job ID " + jobIdStr + " in state store", e);
  }

  JobShuffleInfoProto proto = JobShuffleInfoProto.parseFrom(data);
  String user = proto.getUser();
  TokenProto tokenProto = proto.getJobToken();
  Token<JobTokenIdentifier> jobToken = new Token<JobTokenIdentifier>(
      tokenProto.getIdentifier().toByteArray(),
      tokenProto.getPassword().toByteArray(),
      new Text(tokenProto.getKind()), new Text(tokenProto.getService()));
  addJobToken(jobId, user, jobToken);
}
 
Example 6
Source Project: tez   Source File: ShuffleHandler.java    License: Apache License 2.0 6 votes vote down vote up
private void recordJobShuffleInfo(JobID jobId, String user,
    Token<JobTokenIdentifier> jobToken) throws IOException {
  if (stateDb != null) {
    TokenProto tokenProto = TokenProto.newBuilder()
        .setIdentifier(ByteString.copyFrom(jobToken.getIdentifier()))
        .setPassword(ByteString.copyFrom(jobToken.getPassword()))
        .setKind(jobToken.getKind().toString())
        .setService(jobToken.getService().toString())
        .build();
    JobShuffleInfoProto proto = JobShuffleInfoProto.newBuilder()
        .setUser(user).setJobToken(tokenProto).build();
    try {
      stateDb.put(bytes(jobId.toString()), proto.toByteArray());
    } catch (DBException e) {
      throw new IOException("Error storing " + jobId, e);
    }
  }
  addJobToken(jobId, user, jobToken);
}