public TCreateSentryRoleResponse deepCopy() { return new TCreateSentryRoleResponse(this); }
/** * Performs a deep copy on <i>other</i>. */ public create_sentry_role_result(create_sentry_role_result other) { if (other.isSetSuccess()) { this.success = new TCreateSentryRoleResponse(other.success); } }
@Override public void create_sentry_role(CommitContext context, TCreateSentryRoleRequest request, TCreateSentryRoleResponse response) { for (NotificationHandler handler : handlers) { try { LOGGER.debug("Calling " + handler); handler.create_sentry_role(context, new TCreateSentryRoleRequest(request), new TCreateSentryRoleResponse(response)); } catch (Exception ex) { LOGGER.error("Unexpected error in " + handler + ". Request: " + request + ", Response: " + response, ex); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, create_sentry_role_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCreateSentryRoleResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } }
public void read(org.apache.thrift.protocol.TProtocol iprot, create_sentry_role_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new TCreateSentryRoleResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
@Test public void testCreateSentryRole() throws Exception { TCreateSentryRoleRequest request = new TCreateSentryRoleRequest(); TCreateSentryRoleResponse response = new TCreateSentryRoleResponse(); invoker.create_sentry_role(commitContext, request, response); Mockito.verify(handler).create_sentry_role(commitContext, request, response); }
TCreateSentryRoleRequest request) throws TException { final Timer.Context timerContext = sentryMetrics.createRoleTimer.time(); TCreateSentryRoleResponse response = new TCreateSentryRoleResponse(); try { validateClientVersion(request.getProtocol_version());
@Test public void testCreateRole() { TCreateSentryRoleRequest request = new TCreateSentryRoleRequest(); TCreateSentryRoleResponse response = new TCreateSentryRoleResponse(); request.setRequestorUserName(TEST_USER_NAME); request.setRoleName(TEST_ROLE_NAME); response.setStatus(Status.OK()); DBAuditMetadataLogEntity amle = (DBAuditMetadataLogEntity) JsonLogEntityFactory .getInstance().createJsonLogEntity(request, response, conf); assertCommon(amle, Constants.TRUE, Constants.OPERATION_CREATE_ROLE, "CREATE ROLE testRole", null, null, null, Constants.OBJECT_TYPE_ROLE); response.setStatus(Status.InvalidInput("", null)); amle = (DBAuditMetadataLogEntity) JsonLogEntityFactory.getInstance() .createJsonLogEntity(request, response, conf); assertCommon(amle, Constants.FALSE, Constants.OPERATION_CREATE_ROLE, "CREATE ROLE testRole", null, null, null, Constants.OBJECT_TYPE_ROLE); }