Java 类org.apache.hadoop.yarn.api.protocolrecords.impl.pb.GetApplicationsRequestPBImpl 实例源码

项目:hadoop    文件:ApplicationHistoryProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse
    getApplications(GetApplicationsRequest request) throws YarnException,
        IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationHistoryProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse
    getApplications(GetApplicationsRequest request) throws YarnException,
        IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:big-c    文件:ApplicationHistoryProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse
    getApplications(GetApplicationsRequest request) throws YarnException,
        IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:big-c    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationHistoryProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse
    getApplications(GetApplicationsRequest request) throws YarnException,
        IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-plus    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hops    文件:ApplicationHistoryProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse
    getApplications(GetApplicationsRequest request) throws YarnException,
        IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hops    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-TCP    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hardfs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-on-lustre2    文件:ApplicationHistoryProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse
    getApplications(GetApplicationsRequest request) throws YarnException,
        IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-on-lustre2    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public GetApplicationsResponse getApplications(
    GetApplicationsRequest request) throws YarnException,
    IOException {
  GetApplicationsRequestProto requestProto =
      ((GetApplicationsRequestPBImpl) request).getProto();
  try {
    return new GetApplicationsResponsePBImpl(proxy.getApplications(
      null, requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop    文件:TestGetApplicationsRequest.java   
@Test
public void testGetApplicationsRequest(){
  GetApplicationsRequest request = GetApplicationsRequest.newInstance();

  EnumSet<YarnApplicationState> appStates = 
    EnumSet.of(YarnApplicationState.ACCEPTED);
  request.setApplicationStates(appStates);

  Set<String> tags = new HashSet<String>();
  tags.add("tag1");
  request.setApplicationTags(tags);

  Set<String> types = new HashSet<String>();
  types.add("type1");
  request.setApplicationTypes(types);

  long startBegin = System.currentTimeMillis();
  long startEnd = System.currentTimeMillis() + 1;
  request.setStartRange(startBegin, startEnd);
  long finishBegin = System.currentTimeMillis() + 2;
  long finishEnd = System.currentTimeMillis() + 3;
  request.setFinishRange(finishBegin, finishEnd);

  long limit = 100L;
  request.setLimit(limit);

  Set<String> queues = new HashSet<String>();
  queues.add("queue1");
  request.setQueues(queues);


  Set<String> users = new HashSet<String>();
  users.add("user1");
  request.setUsers(users);

  ApplicationsRequestScope scope = ApplicationsRequestScope.ALL;
  request.setScope(scope);

  GetApplicationsRequest requestFromProto = new GetApplicationsRequestPBImpl(
      ((GetApplicationsRequestPBImpl)request).getProto());

  // verify the whole record equals with original record
  Assert.assertEquals(requestFromProto, request);

  // verify all properties are the same as original request
  Assert.assertEquals(
      "ApplicationStates from proto is not the same with original request",
      requestFromProto.getApplicationStates(), appStates);

  Assert.assertEquals(
      "ApplicationTags from proto is not the same with original request",
      requestFromProto.getApplicationTags(), tags);

  Assert.assertEquals(
      "ApplicationTypes from proto is not the same with original request",
      requestFromProto.getApplicationTypes(), types);

  Assert.assertEquals(
      "StartRange from proto is not the same with original request",
      requestFromProto.getStartRange(), new LongRange(startBegin, startEnd));

  Assert.assertEquals(
      "FinishRange from proto is not the same with original request",
      requestFromProto.getFinishRange(), new LongRange(finishBegin, finishEnd));

  Assert.assertEquals(
      "Limit from proto is not the same with original request",
      requestFromProto.getLimit(), limit);

  Assert.assertEquals(
      "Queues from proto is not the same with original request",
      requestFromProto.getQueues(), queues);

  Assert.assertEquals(
      "Users from proto is not the same with original request",
      requestFromProto.getUsers(), users);
}
项目:aliyun-oss-hadoop-fs    文件:TestGetApplicationsRequest.java   
@Test
public void testGetApplicationsRequest(){
  GetApplicationsRequest request = GetApplicationsRequest.newInstance();

  EnumSet<YarnApplicationState> appStates = 
    EnumSet.of(YarnApplicationState.ACCEPTED);
  request.setApplicationStates(appStates);

  Set<String> tags = new HashSet<String>();
  tags.add("tag1");
  request.setApplicationTags(tags);

  Set<String> types = new HashSet<String>();
  types.add("type1");
  request.setApplicationTypes(types);

  long startBegin = System.currentTimeMillis();
  long startEnd = System.currentTimeMillis() + 1;
  request.setStartRange(startBegin, startEnd);
  long finishBegin = System.currentTimeMillis() + 2;
  long finishEnd = System.currentTimeMillis() + 3;
  request.setFinishRange(finishBegin, finishEnd);

  long limit = 100L;
  request.setLimit(limit);

  Set<String> queues = new HashSet<String>();
  queues.add("queue1");
  request.setQueues(queues);


  Set<String> users = new HashSet<String>();
  users.add("user1");
  request.setUsers(users);

  ApplicationsRequestScope scope = ApplicationsRequestScope.ALL;
  request.setScope(scope);

  GetApplicationsRequest requestFromProto = new GetApplicationsRequestPBImpl(
      ((GetApplicationsRequestPBImpl)request).getProto());

  // verify the whole record equals with original record
  Assert.assertEquals(requestFromProto, request);

  // verify all properties are the same as original request
  Assert.assertEquals(
      "ApplicationStates from proto is not the same with original request",
      requestFromProto.getApplicationStates(), appStates);

  Assert.assertEquals(
      "ApplicationTags from proto is not the same with original request",
      requestFromProto.getApplicationTags(), tags);

  Assert.assertEquals(
      "ApplicationTypes from proto is not the same with original request",
      requestFromProto.getApplicationTypes(), types);

  Assert.assertEquals(
      "StartRange from proto is not the same with original request",
      requestFromProto.getStartRange(), new LongRange(startBegin, startEnd));

  Assert.assertEquals(
      "FinishRange from proto is not the same with original request",
      requestFromProto.getFinishRange(), new LongRange(finishBegin, finishEnd));

  Assert.assertEquals(
      "Limit from proto is not the same with original request",
      requestFromProto.getLimit(), limit);

  Assert.assertEquals(
      "Queues from proto is not the same with original request",
      requestFromProto.getQueues(), queues);

  Assert.assertEquals(
      "Users from proto is not the same with original request",
      requestFromProto.getUsers(), users);
}
项目:aliyun-oss-hadoop-fs    文件:TestPBImplRecords.java   
@Test
public void testGetApplicationsRequestPBImpl() throws Exception {
  validatePBImplRecord(GetApplicationsRequestPBImpl.class,
      GetApplicationsRequestProto.class);
}
项目:big-c    文件:TestGetApplicationsRequest.java   
@Test
public void testGetApplicationsRequest(){
  GetApplicationsRequest request = GetApplicationsRequest.newInstance();

  EnumSet<YarnApplicationState> appStates = 
    EnumSet.of(YarnApplicationState.ACCEPTED);
  request.setApplicationStates(appStates);

  Set<String> tags = new HashSet<String>();
  tags.add("tag1");
  request.setApplicationTags(tags);

  Set<String> types = new HashSet<String>();
  types.add("type1");
  request.setApplicationTypes(types);

  long startBegin = System.currentTimeMillis();
  long startEnd = System.currentTimeMillis() + 1;
  request.setStartRange(startBegin, startEnd);
  long finishBegin = System.currentTimeMillis() + 2;
  long finishEnd = System.currentTimeMillis() + 3;
  request.setFinishRange(finishBegin, finishEnd);

  long limit = 100L;
  request.setLimit(limit);

  Set<String> queues = new HashSet<String>();
  queues.add("queue1");
  request.setQueues(queues);


  Set<String> users = new HashSet<String>();
  users.add("user1");
  request.setUsers(users);

  ApplicationsRequestScope scope = ApplicationsRequestScope.ALL;
  request.setScope(scope);

  GetApplicationsRequest requestFromProto = new GetApplicationsRequestPBImpl(
      ((GetApplicationsRequestPBImpl)request).getProto());

  // verify the whole record equals with original record
  Assert.assertEquals(requestFromProto, request);

  // verify all properties are the same as original request
  Assert.assertEquals(
      "ApplicationStates from proto is not the same with original request",
      requestFromProto.getApplicationStates(), appStates);

  Assert.assertEquals(
      "ApplicationTags from proto is not the same with original request",
      requestFromProto.getApplicationTags(), tags);

  Assert.assertEquals(
      "ApplicationTypes from proto is not the same with original request",
      requestFromProto.getApplicationTypes(), types);

  Assert.assertEquals(
      "StartRange from proto is not the same with original request",
      requestFromProto.getStartRange(), new LongRange(startBegin, startEnd));

  Assert.assertEquals(
      "FinishRange from proto is not the same with original request",
      requestFromProto.getFinishRange(), new LongRange(finishBegin, finishEnd));

  Assert.assertEquals(
      "Limit from proto is not the same with original request",
      requestFromProto.getLimit(), limit);

  Assert.assertEquals(
      "Queues from proto is not the same with original request",
      requestFromProto.getQueues(), queues);

  Assert.assertEquals(
      "Users from proto is not the same with original request",
      requestFromProto.getUsers(), users);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGetApplicationsRequest.java   
@Test
public void testGetApplicationsRequest(){
  GetApplicationsRequest request = GetApplicationsRequest.newInstance();

  EnumSet<YarnApplicationState> appStates = 
    EnumSet.of(YarnApplicationState.ACCEPTED);
  request.setApplicationStates(appStates);

  Set<String> tags = new HashSet<String>();
  tags.add("tag1");
  request.setApplicationTags(tags);

  Set<String> types = new HashSet<String>();
  types.add("type1");
  request.setApplicationTypes(types);

  long startBegin = System.currentTimeMillis();
  long startEnd = System.currentTimeMillis() + 1;
  request.setStartRange(startBegin, startEnd);
  long finishBegin = System.currentTimeMillis() + 2;
  long finishEnd = System.currentTimeMillis() + 3;
  request.setFinishRange(finishBegin, finishEnd);

  long limit = 100L;
  request.setLimit(limit);

  Set<String> queues = new HashSet<String>();
  queues.add("queue1");
  request.setQueues(queues);


  Set<String> users = new HashSet<String>();
  users.add("user1");
  request.setUsers(users);

  ApplicationsRequestScope scope = ApplicationsRequestScope.ALL;
  request.setScope(scope);

  GetApplicationsRequest requestFromProto = new GetApplicationsRequestPBImpl(
      ((GetApplicationsRequestPBImpl)request).getProto());

  // verify the whole record equals with original record
  Assert.assertEquals(requestFromProto, request);

  // verify all properties are the same as original request
  Assert.assertEquals(
      "ApplicationStates from proto is not the same with original request",
      requestFromProto.getApplicationStates(), appStates);

  Assert.assertEquals(
      "ApplicationTags from proto is not the same with original request",
      requestFromProto.getApplicationTags(), tags);

  Assert.assertEquals(
      "ApplicationTypes from proto is not the same with original request",
      requestFromProto.getApplicationTypes(), types);

  Assert.assertEquals(
      "StartRange from proto is not the same with original request",
      requestFromProto.getStartRange(), new LongRange(startBegin, startEnd));

  Assert.assertEquals(
      "FinishRange from proto is not the same with original request",
      requestFromProto.getFinishRange(), new LongRange(finishBegin, finishEnd));

  Assert.assertEquals(
      "Limit from proto is not the same with original request",
      requestFromProto.getLimit(), limit);

  Assert.assertEquals(
      "Queues from proto is not the same with original request",
      requestFromProto.getQueues(), queues);

  Assert.assertEquals(
      "Users from proto is not the same with original request",
      requestFromProto.getUsers(), users);
}
项目:hops    文件:TestGetApplicationsRequest.java   
@Test
public void testGetApplicationsRequest(){
  GetApplicationsRequest request = GetApplicationsRequest.newInstance();

  EnumSet<YarnApplicationState> appStates = 
    EnumSet.of(YarnApplicationState.ACCEPTED);
  request.setApplicationStates(appStates);

  Set<String> tags = new HashSet<String>();
  tags.add("tag1");
  request.setApplicationTags(tags);

  Set<String> types = new HashSet<String>();
  types.add("type1");
  request.setApplicationTypes(types);

  long startBegin = System.currentTimeMillis();
  long startEnd = System.currentTimeMillis() + 1;
  request.setStartRange(startBegin, startEnd);
  long finishBegin = System.currentTimeMillis() + 2;
  long finishEnd = System.currentTimeMillis() + 3;
  request.setFinishRange(finishBegin, finishEnd);

  long limit = 100L;
  request.setLimit(limit);

  Set<String> queues = new HashSet<String>();
  queues.add("queue1");
  request.setQueues(queues);


  Set<String> users = new HashSet<String>();
  users.add("user1");
  request.setUsers(users);

  ApplicationsRequestScope scope = ApplicationsRequestScope.ALL;
  request.setScope(scope);

  GetApplicationsRequest requestFromProto = new GetApplicationsRequestPBImpl(
      ((GetApplicationsRequestPBImpl)request).getProto());

  // verify the whole record equals with original record
  Assert.assertEquals(requestFromProto, request);

  // verify all properties are the same as original request
  Assert.assertEquals(
      "ApplicationStates from proto is not the same with original request",
      requestFromProto.getApplicationStates(), appStates);

  Assert.assertEquals(
      "ApplicationTags from proto is not the same with original request",
      requestFromProto.getApplicationTags(), tags);

  Assert.assertEquals(
      "ApplicationTypes from proto is not the same with original request",
      requestFromProto.getApplicationTypes(), types);

  Assert.assertEquals(
      "StartRange from proto is not the same with original request",
      requestFromProto.getStartRange(), new LongRange(startBegin, startEnd));

  Assert.assertEquals(
      "FinishRange from proto is not the same with original request",
      requestFromProto.getFinishRange(), new LongRange(finishBegin, finishEnd));

  Assert.assertEquals(
      "Limit from proto is not the same with original request",
      requestFromProto.getLimit(), limit);

  Assert.assertEquals(
      "Queues from proto is not the same with original request",
      requestFromProto.getQueues(), queues);

  Assert.assertEquals(
      "Users from proto is not the same with original request",
      requestFromProto.getUsers(), users);
}
项目:hops    文件:TestPBImplRecords.java   
@Test
public void testGetApplicationsRequestPBImpl() throws Exception {
  validatePBImplRecord(GetApplicationsRequestPBImpl.class,
      GetApplicationsRequestProto.class);
}