Search in sources :

Example 6 with ApplicationACLMapProto

use of org.apache.hadoop.yarn.proto.YarnProtos.ApplicationACLMapProto in project hadoop by apache.

the class ContainerLaunchContextPBImpl method addApplicationACLs.

private void addApplicationACLs() {
    maybeInitBuilder();
    builder.clearApplicationACLs();
    if (applicationACLS == null) {
        return;
    }
    Iterable<? extends ApplicationACLMapProto> values = new Iterable<ApplicationACLMapProto>() {

        @Override
        public Iterator<ApplicationACLMapProto> iterator() {
            return new Iterator<ApplicationACLMapProto>() {

                Iterator<ApplicationAccessType> aclsIterator = applicationACLS.keySet().iterator();

                @Override
                public boolean hasNext() {
                    return aclsIterator.hasNext();
                }

                @Override
                public ApplicationACLMapProto next() {
                    ApplicationAccessType key = aclsIterator.next();
                    return ApplicationACLMapProto.newBuilder().setAcl(applicationACLS.get(key)).setAccessType(ProtoUtils.convertToProtoFormat(key)).build();
                }

                @Override
                public void remove() {
                    throw new UnsupportedOperationException();
                }
            };
        }
    };
    this.builder.addAllApplicationACLs(values);
}
Also used : ApplicationAccessType(org.apache.hadoop.yarn.api.records.ApplicationAccessType) ApplicationACLMapProto(org.apache.hadoop.yarn.proto.YarnProtos.ApplicationACLMapProto) Iterator(java.util.Iterator)

Aggregations

ApplicationAccessType (org.apache.hadoop.yarn.api.records.ApplicationAccessType)6 ApplicationACLMapProto (org.apache.hadoop.yarn.proto.YarnProtos.ApplicationACLMapProto)6 ByteString (com.google.protobuf.ByteString)4 HashMap (java.util.HashMap)2 DataInputStream (java.io.DataInputStream)1 IOException (java.io.IOException)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 DataOutputBuffer (org.apache.hadoop.io.DataOutputBuffer)1 Credentials (org.apache.hadoop.security.Credentials)1 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 LogAggregationContext (org.apache.hadoop.yarn.api.records.LogAggregationContext)1 ApplicationIdPBImpl (org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl)1 LogAggregationContextPBImpl (org.apache.hadoop.yarn.api.records.impl.pb.LogAggregationContextPBImpl)1 ContainerLaunchContextProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnProtos.ContainerLaunchContextProtoOrBuilder)1 ContainerManagerApplicationProto (org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.ContainerManagerApplicationProto)1 RegisterApplicationMasterResponseProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterResponseProtoOrBuilder)1 ApplicationImpl (org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationImpl)1 ApplicationInitEvent (org.apache.hadoop.yarn.server.nodemanager.containermanager.application.ApplicationInitEvent)1