org.apache.thrift.protocol.TProtocolException Java Examples

The following examples show how to use org.apache.thrift.protocol.TProtocolException. 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 File: TPathsUpdate.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetHasFullImage()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasFullImage' is unset! Struct:" + toString());
  }

  if (!isSetSeqNum()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'seqNum' is unset! Struct:" + toString());
  }

  if (!isSetPathChanges()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'pathChanges' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (pathsDump != null) {
    pathsDump.validate();
  }
}
 
Example #2
Source File: TSentryPrivilege.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetComponent()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'component' is unset! Struct:" + toString());
  }

  if (!isSetServiceName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'serviceName' is unset! Struct:" + toString());
  }

  if (!isSetAuthorizables()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'authorizables' is unset! Struct:" + toString());
  }

  if (!isSetAction()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'action' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #3
Source File: TPathChanges.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetAuthzObj()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzObj' is unset! Struct:" + toString());
  }

  if (!isSetAddPaths()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'addPaths' is unset! Struct:" + toString());
  }

  if (!isSetDelPaths()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'delPaths' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #4
Source File: TDropPrivilegesRequest.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetProtocol_version()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
  }

  if (!isSetRequestorUserName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestorUserName' is unset! Struct:" + toString());
  }

  if (!isSetPrivilege()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'privilege' is unset! Struct:" + toString());
  }

  if (!isSetComponent()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'component' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (privilege != null) {
    privilege.validate();
  }
}
 
Example #5
Source File: ThriftRequestProperty.java    From pinpoint with Apache License 2.0 6 votes vote down vote up
public void setTraceHeader(ThriftHeader headerKey, Object value) throws TException {
    byte headerType = headerKey.getType();
    if (headerType == TType.STRING) {
        // skipped Strings are read as byte buffer.
        // see org.apache.thrift.protocol.TProtocolUtil.skip(TProtocol, byte, int)
        this.thriftHeaders.put(headerKey, byteBufferToString((ByteBuffer)value));
    } else if (headerType == TType.I64) {
        this.thriftHeaders.put(headerKey, (Long)value);
    } else if (headerType == TType.I16) {
        this.thriftHeaders.put(headerKey, (Short)value);
    } else if (headerType == TType.BOOL) {
        this.thriftHeaders.put(headerKey, (Boolean)value);
    } else {
        throw new TProtocolException("Invalid pinpoint header type - " + headerType);
    }
}
 
Example #6
Source File: TListSentryPrivilegesByAuthRequest.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetProtocol_version()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
  }

  if (!isSetRequestorUserName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestorUserName' is unset! Struct:" + toString());
  }

  if (!isSetAuthorizableSet()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'authorizableSet' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (roleSet != null) {
    roleSet.validate();
  }
}
 
Example #7
Source File: SyncOfferMessage.java    From floodlight_with_topoguard with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (header == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'header' was not present! Struct: " + toString());
  }
  if (store == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'store' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
  if (header != null) {
    header.validate();
  }
  if (store != null) {
    store.validate();
  }
}
 
Example #8
Source File: PutRequestMessage.java    From floodlight_with_topoguard with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (header == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'header' was not present! Struct: " + toString());
  }
  if (storeName == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'storeName' was not present! Struct: " + toString());
  }
  if (key == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
  if (header != null) {
    header.validate();
  }
  if (versionedValue != null) {
    versionedValue.validate();
  }
}
 
Example #9
Source File: ErrorInfo.java    From jstorm with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!is_set_error()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'error' is unset! Struct:" + toString());
  }

  if (!is_set_errorTimeSecs()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'errorTimeSecs' is unset! Struct:" + toString());
  }

  if (!is_set_errorLevel()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'errorLevel' is unset! Struct:" + toString());
  }

  if (!is_set_errorCode()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'errorCode' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #10
Source File: AckResult.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (consumerId == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'consumerId' was not present! Struct: " + toString());
  }
  if (groupId == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'groupId' was not present! Struct: " + toString());
  }
  if (cluster == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'cluster' was not present! Struct: " + toString());
  }
  if (offsets == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'offsets' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
}
 
Example #11
Source File: TDropPrivilegesRequest.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetProtocol_version()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
  }

  if (!isSetRequestorUserName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestorUserName' is unset! Struct:" + toString());
  }

  if (!isSetAuthorizable()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'authorizable' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (authorizable != null) {
    authorizable.validate();
  }
}
 
Example #12
Source File: TopologyInfo.java    From jstorm with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!is_set_topology()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'topology' is unset! Struct:" + toString());
  }

  if (!is_set_components()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'components' is unset! Struct:" + toString());
  }

  if (!is_set_tasks()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'tasks' is unset! Struct:" + toString());
  }

  if (!is_set_metrics()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'metrics' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (topology != null) {
    topology.validate();
  }
  if (metrics != null) {
    metrics.validate();
  }
}
 
Example #13
Source File: TAlterSentryRoleAddGroupsRequest.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetProtocol_version()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
  }

  if (!isSetRequestorUserName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestorUserName' is unset! Struct:" + toString());
  }

  if (!isSetRoleName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleName' is unset! Struct:" + toString());
  }

  if (!isSetComponent()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'component' is unset! Struct:" + toString());
  }

  if (!isSetGroups()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'groups' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #14
Source File: TDropSentryRoleRequest.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetProtocol_version()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
  }

  if (!isSetRequestorUserName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestorUserName' is unset! Struct:" + toString());
  }

  if (!isSetRoleName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleName' is unset! Struct:" + toString());
  }

  if (!isSetComponent()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'component' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #15
Source File: ClusterJoinRequestMessage.java    From floodlight_with_topoguard with Apache License 2.0 6 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (header == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'header' was not present! Struct: " + toString());
  }
  if (node == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'node' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
  if (header != null) {
    header.validate();
  }
  if (node != null) {
    node.validate();
  }
}
 
Example #16
Source File: TokenRange.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (start_token == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'start_token' was not present! Struct: " + toString());
  }
  if (end_token == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'end_token' was not present! Struct: " + toString());
  }
  if (endpoints == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'endpoints' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
}
 
Example #17
Source File: TSentryRole.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetRoleName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleName' is unset! Struct:" + toString());
  }

  if (!isSetGroups()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'groups' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #18
Source File: TAuthorizable.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetType()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString());
  }

  if (!isSetName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #19
Source File: TDropPrivilegesResponse.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetStatus()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (status != null) {
    status.validate();
  }
}
 
Example #20
Source File: ColumnParent.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (column_family == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'column_family' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
}
 
Example #21
Source File: HelloMessage.java    From floodlight_with_topoguard with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (header == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'header' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
  if (header != null) {
    header.validate();
  }
  if (authChallengeResponse != null) {
    authChallengeResponse.validate();
  }
}
 
Example #22
Source File: TListSentryRolesRequest.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetProtocol_version()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
  }

  if (!isSetRequestorUserName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestorUserName' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #23
Source File: RDF_PrefixName.java    From rdf-delta with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (prefix == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'prefix' was not present! Struct: " + toString());
  }
  if (localName == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'localName' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
}
 
Example #24
Source File: PDXSchema.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (nodes == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'nodes' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
}
 
Example #25
Source File: TAlterSentryRoleAddGroupsResponse.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetStatus()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
}
 
Example #26
Source File: TListSentryPrivilegesForProviderRequest.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetProtocol_version()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
  }

  if (!isSetComponent()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'component' is unset! Struct:" + toString());
  }

  if (!isSetServiceName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'serviceName' is unset! Struct:" + toString());
  }

  if (!isSetGroups()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'groups' is unset! Struct:" + toString());
  }

  if (!isSetRoleSet()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleSet' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (roleSet != null) {
    roleSet.validate();
  }
}
 
Example #27
Source File: TListSentryPrivilegesByAuthRequest.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!isSetProtocol_version()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
  }

  if (!isSetRequestorUserName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestorUserName' is unset! Struct:" + toString());
  }

  if (!isSetComponent()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'component' is unset! Struct:" + toString());
  }

  if (!isSetServiceName()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'serviceName' is unset! Struct:" + toString());
  }

  if (!isSetAuthorizablesSet()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'authorizablesSet' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (roleSet != null) {
    roleSet.validate();
  }
}
 
Example #28
Source File: DateTime.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public void read(org.apache.thrift.protocol.TProtocol iprot, DateTime 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 1: // SECS_SINCE_EPOCH
        if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
          struct.secsSinceEpoch = iprot.readI64();
          struct.setSecsSinceEpochIsSet(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();

  // check for required fields of primitive type, which can't be checked in the validate method
  if (!struct.isSetSecsSinceEpoch()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'secsSinceEpoch' was not found in serialized data! Struct: " + toString());
  }
  struct.validate();
}
 
Example #29
Source File: ConnectionProperties.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  // alas, we cannot check 'connId' because it's a primitive and you chose the non-beans generator.
  if (clientHostName == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientHostName' was not present! Struct: " + toString());
  }
  if (clientID == null) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientID' was not present! Struct: " + toString());
  }
  // check for sub-struct validity
}
 
Example #30
Source File: SubmitOptions.java    From jstorm with Apache License 2.0 5 votes vote down vote up
public void validate() throws org.apache.thrift.TException {
  // check for required fields
  if (!is_set_initial_status()) {
    throw new org.apache.thrift.protocol.TProtocolException("Required field 'initial_status' is unset! Struct:" + toString());
  }

  // check for sub-struct validity
  if (creds != null) {
    creds.validate();
  }
}