|
| 1 | +/** |
| 2 | +* Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +* or more contributor license agreements. See the NOTICE file |
| 4 | +* distributed with this work for additional information |
| 5 | +* regarding copyright ownership. The ASF licenses this file |
| 6 | +* to you under the Apache License, Version 2.0 (the |
| 7 | +* "License"); you may not use this file except in compliance |
| 8 | +* with the License. You may obtain a copy of the License at |
| 9 | +* |
| 10 | +* http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +* |
| 12 | +* Unless required by applicable law or agreed to in writing, software |
| 13 | +* distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +* See the License for the specific language governing permissions and |
| 16 | +* limitations under the License. |
| 17 | +*/ |
| 18 | + |
| 19 | +package org.apache.hadoop.yarn.server.nodemanager; |
| 20 | + |
| 21 | +import java.io.File; |
| 22 | +import java.io.IOException; |
| 23 | +import java.net.InetSocketAddress; |
| 24 | +import java.util.ArrayList; |
| 25 | +import java.util.Arrays; |
| 26 | +import java.util.List; |
| 27 | +import java.util.regex.Pattern; |
| 28 | + |
| 29 | +import org.apache.commons.logging.Log; |
| 30 | +import org.apache.commons.logging.LogFactory; |
| 31 | +import org.apache.hadoop.conf.Configuration; |
| 32 | +import org.apache.hadoop.fs.Path; |
| 33 | +import org.apache.hadoop.security.UserGroupInformation; |
| 34 | +import org.apache.hadoop.util.ReflectionUtils; |
| 35 | +import org.apache.hadoop.util.Shell.ExitCodeException; |
| 36 | +import org.apache.hadoop.util.Shell.ShellCommandExecutor; |
| 37 | +import org.apache.hadoop.util.StringUtils; |
| 38 | +import org.apache.hadoop.yarn.api.ApplicationConstants; |
| 39 | +import org.apache.hadoop.yarn.api.records.ContainerId; |
| 40 | +import org.apache.hadoop.yarn.conf.YarnConfiguration; |
| 41 | +import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.ExitCode; |
| 42 | +import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.Signal; |
| 43 | +import org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor; |
| 44 | +import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container; |
| 45 | +import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerDiagnosticsUpdateEvent; |
| 46 | +import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ContainerLocalizer; |
| 47 | +import org.apache.hadoop.yarn.server.nodemanager.util.DefaultLCEResourcesHandler; |
| 48 | +import org.apache.hadoop.yarn.server.nodemanager.util.LCEResourcesHandler; |
| 49 | +import org.apache.hadoop.yarn.util.ConverterUtils; |
| 50 | +import org.apache.log4j.spi.LoggerFactory; |
| 51 | +import org.slf4j.Logger; |
| 52 | +public class GlusterContainerExecutor extends LinuxContainerExecutor { |
| 53 | + |
| 54 | + static Logger log = org.slf4j.LoggerFactory.getLogger(GlusterContainerExecutor.class); |
| 55 | + /** |
| 56 | + * We override the YARN-1235 patch here. |
| 57 | + * @param user |
| 58 | + * @return |
| 59 | + */ |
| 60 | + @Override |
| 61 | + String getRunAsUser(String user) { |
| 62 | + log.info("Container EXEC overrid: returning user " + user); |
| 63 | + //return UserGroupInformation.isSecurityEnabled() ? user : nonsecureLocalUser; |
| 64 | + return user; |
| 65 | + } |
| 66 | +@Override |
| 67 | +public void deleteAsUser(String arg0,Path arg1,Path...arg2){ |
| 68 | + log.info("DELETE AS USER " + arg0 + " " + arg1 +" " + arg2); |
| 69 | + super.deleteAsUser(arg0, arg1, arg2); |
| 70 | +} |
| 71 | +} |
| 72 | + |
0 commit comments