http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/LlapNodeId.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/LlapNodeId.java b/llap-common/src/java/org/apache/hadoop/hive/llap/LlapNodeId.java new file mode 100644 index 0000000..515bf3c --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/LlapNodeId.java @@ -0,0 +1,86 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; + +public class LlapNodeId { + + private static final LoadingCache<LlapNodeId, LlapNodeId> CACHE = + CacheBuilder.newBuilder().softValues().build( + new CacheLoader<LlapNodeId, LlapNodeId>() { + @Override + public LlapNodeId load(LlapNodeId key) throws Exception { + return key; + } + }); + + public static LlapNodeId getInstance(String hostname, int port) { + return CACHE.getUnchecked(new LlapNodeId(hostname, port)); + } + + + private final String hostname; + private final int port; + + + private LlapNodeId(String hostname, int port) { + this.hostname = hostname; + this.port = port; + } + + public String getHostname() { + return hostname; + } + + public int getPort() { + return port; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + LlapNodeId that = (LlapNodeId) o; + + if (port != that.port) { + return false; + } + if (!hostname.equals(that.hostname)) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = hostname.hashCode(); + result = 1009 * result + port; + return result; + } + + @Override + public String toString() { + return hostname + ":" + port; + } +}
http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/impl/LlapManagementProtocolClientImpl.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/impl/LlapManagementProtocolClientImpl.java b/llap-common/src/java/org/apache/hadoop/hive/llap/impl/LlapManagementProtocolClientImpl.java new file mode 100644 index 0000000..cd11bdb --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/impl/LlapManagementProtocolClientImpl.java @@ -0,0 +1,82 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap.impl; + +import javax.annotation.Nullable; +import javax.net.SocketFactory; +import java.io.IOException; +import java.net.InetSocketAddress; + +import com.google.protobuf.RpcController; +import com.google.protobuf.ServiceException; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.io.retry.RetryPolicy; +import org.apache.hadoop.ipc.ProtobufRpcEngine; +import org.apache.hadoop.ipc.ProtocolProxy; +import org.apache.hadoop.ipc.RPC; +import org.apache.hadoop.net.NetUtils; +import org.apache.hadoop.hive.llap.protocol.LlapManagementProtocolPB; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.GetTokenRequestProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.GetTokenResponseProto; +import org.apache.hadoop.security.UserGroupInformation; + +public class LlapManagementProtocolClientImpl implements LlapManagementProtocolPB { + + private final Configuration conf; + private final InetSocketAddress serverAddr; + private final RetryPolicy retryPolicy; + private final SocketFactory socketFactory; + LlapManagementProtocolPB proxy; + + + public LlapManagementProtocolClientImpl(Configuration conf, String hostname, int port, + @Nullable RetryPolicy retryPolicy, + @Nullable SocketFactory socketFactory) { + this.conf = conf; + this.serverAddr = NetUtils.createSocketAddr(hostname, port); + this.retryPolicy = retryPolicy; + if (socketFactory == null) { + this.socketFactory = NetUtils.getDefaultSocketFactory(conf); + } else { + this.socketFactory = socketFactory; + } + } + + public LlapManagementProtocolPB getProxy() throws IOException { + if (proxy == null) { + proxy = createProxy(); + } + return proxy; + } + + public LlapManagementProtocolPB createProxy() throws IOException { + RPC.setProtocolEngine(conf, LlapManagementProtocolPB.class, ProtobufRpcEngine.class); + ProtocolProxy<LlapManagementProtocolPB> proxy = + RPC.getProtocolProxy(LlapManagementProtocolPB.class, 0, serverAddr, + UserGroupInformation.getCurrentUser(), conf, NetUtils.getDefaultSocketFactory(conf), 0, + retryPolicy); + return proxy.getProxy(); + } + + @Override + public GetTokenResponseProto getDelegationToken(RpcController controller, + GetTokenRequestProto request) throws ServiceException { + try { + return getProxy().getDelegationToken(null, request); + } catch (IOException e) { + throw new ServiceException(e); + } + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/impl/LlapProtocolClientImpl.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/impl/LlapProtocolClientImpl.java b/llap-common/src/java/org/apache/hadoop/hive/llap/impl/LlapProtocolClientImpl.java new file mode 100644 index 0000000..9234b7d --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/impl/LlapProtocolClientImpl.java @@ -0,0 +1,125 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap.impl; + +import javax.annotation.Nullable; +import javax.net.SocketFactory; +import java.io.IOException; +import java.net.InetSocketAddress; + +import com.google.protobuf.RpcController; +import com.google.protobuf.ServiceException; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.QueryCompleteRequestProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.QueryCompleteResponseProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SourceStateUpdatedRequestProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SourceStateUpdatedResponseProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SubmitWorkRequestProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SubmitWorkResponseProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.TerminateFragmentRequestProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.TerminateFragmentResponseProto; +import org.apache.hadoop.io.retry.RetryPolicy; +import org.apache.hadoop.ipc.ProtobufRpcEngine; +import org.apache.hadoop.ipc.ProtocolProxy; +import org.apache.hadoop.ipc.RPC; +import org.apache.hadoop.net.NetUtils; +import org.apache.hadoop.hive.llap.protocol.LlapProtocolBlockingPB; +import org.apache.hadoop.security.UserGroupInformation; + +// TODO Change all this to be based on a regular interface instead of relying on the Proto service - Exception signatures cannot be controlled without this for the moment. + + +public class LlapProtocolClientImpl implements LlapProtocolBlockingPB { + + private final Configuration conf; + private final InetSocketAddress serverAddr; + private final RetryPolicy retryPolicy; + private final SocketFactory socketFactory; + LlapProtocolBlockingPB proxy; + + + public LlapProtocolClientImpl(Configuration conf, String hostname, int port, + @Nullable RetryPolicy retryPolicy, + @Nullable SocketFactory socketFactory) { + this.conf = conf; + this.serverAddr = NetUtils.createSocketAddr(hostname, port); + this.retryPolicy = retryPolicy; + if (socketFactory == null) { + this.socketFactory = NetUtils.getDefaultSocketFactory(conf); + } else { + this.socketFactory = socketFactory; + } + } + + @Override + public SubmitWorkResponseProto submitWork(RpcController controller, + SubmitWorkRequestProto request) throws + ServiceException { + try { + return getProxy().submitWork(null, request); + } catch (IOException e) { + throw new ServiceException(e); + } + } + + @Override + public SourceStateUpdatedResponseProto sourceStateUpdated(RpcController controller, + SourceStateUpdatedRequestProto request) throws + ServiceException { + try { + return getProxy().sourceStateUpdated(null, request); + } catch (IOException e) { + throw new ServiceException(e); + } + } + + @Override + public QueryCompleteResponseProto queryComplete(RpcController controller, + QueryCompleteRequestProto request) throws + ServiceException { + try { + return getProxy().queryComplete(null, request); + } catch (IOException e) { + throw new ServiceException(e); + } + } + + @Override + public TerminateFragmentResponseProto terminateFragment( + RpcController controller, + TerminateFragmentRequestProto request) throws ServiceException { + try { + return getProxy().terminateFragment(null, request); + } catch (IOException e) { + throw new ServiceException(e); + } + } + + public LlapProtocolBlockingPB getProxy() throws IOException { + if (proxy == null) { + proxy = createProxy(); + } + return proxy; + } + + public LlapProtocolBlockingPB createProxy() throws IOException { + RPC.setProtocolEngine(conf, LlapProtocolBlockingPB.class, ProtobufRpcEngine.class); + ProtocolProxy<LlapProtocolBlockingPB> proxy = + RPC.getProtocolProxy(LlapProtocolBlockingPB.class, 0, serverAddr, + UserGroupInformation.getCurrentUser(), conf, NetUtils.getDefaultSocketFactory(conf), 0, + retryPolicy); + return proxy.getProxy(); + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapManagementProtocolPB.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapManagementProtocolPB.java b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapManagementProtocolPB.java new file mode 100644 index 0000000..ff215d4 --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapManagementProtocolPB.java @@ -0,0 +1,26 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.llap.protocol; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos; +import org.apache.hadoop.ipc.ProtocolInfo; +import org.apache.hadoop.security.KerberosInfo; + +@ProtocolInfo(protocolName = "org.apache.hadoop.hive.llap.protocol.LlapManagementProtocolPB", protocolVersion = 1) +@KerberosInfo(serverPrincipal = HiveConf.HIVE_LLAP_DAEMON_SERVICE_PRINCIPAL_NAME) +@InterfaceAudience.Private +public interface LlapManagementProtocolPB extends LlapDaemonProtocolProtos.LlapManagementProtocol.BlockingInterface { +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapProtocolBlockingPB.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapProtocolBlockingPB.java b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapProtocolBlockingPB.java new file mode 100644 index 0000000..2bd56ca --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapProtocolBlockingPB.java @@ -0,0 +1,30 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap.protocol; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.ipc.ProtocolInfo; +import org.apache.hadoop.security.KerberosInfo; +import org.apache.hadoop.security.token.TokenInfo; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos; +import org.apache.hadoop.hive.llap.security.LlapTokenSelector; + +@ProtocolInfo(protocolName = "org.apache.hadoop.hive.llap.protocol.LlapProtocolBlockingPB", protocolVersion = 1) +@KerberosInfo(serverPrincipal = HiveConf.HIVE_LLAP_DAEMON_SERVICE_PRINCIPAL_NAME) +@TokenInfo(LlapTokenSelector.class) +@InterfaceAudience.Private +public interface LlapProtocolBlockingPB extends LlapDaemonProtocolProtos.LlapDaemonProtocol.BlockingInterface { +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapTaskUmbilicalProtocol.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapTaskUmbilicalProtocol.java b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapTaskUmbilicalProtocol.java new file mode 100644 index 0000000..9549567 --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/protocol/LlapTaskUmbilicalProtocol.java @@ -0,0 +1,42 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap.protocol; + +import java.io.IOException; + +import org.apache.hadoop.io.Text; +import org.apache.hadoop.ipc.VersionedProtocol; +import org.apache.hadoop.security.token.TokenInfo; +import org.apache.tez.dag.api.TezException; +import org.apache.tez.dag.records.TezTaskAttemptID; +import org.apache.tez.runtime.api.impl.TezHeartbeatRequest; +import org.apache.tez.runtime.api.impl.TezHeartbeatResponse; +import org.apache.tez.runtime.common.security.JobTokenSelector; + +@TokenInfo(JobTokenSelector.class) +public interface LlapTaskUmbilicalProtocol extends VersionedProtocol { + + public static final long versionID = 1L; + + // From Tez. Eventually changes over to the LLAP protocol and ProtocolBuffers + boolean canCommit(TezTaskAttemptID taskid) throws IOException; + public TezHeartbeatResponse heartbeat(TezHeartbeatRequest request) + throws IOException, TezException; + + public void nodeHeartbeat(Text hostname, int port) throws IOException; + + public void taskKilled(TezTaskAttemptID taskAttemptId) throws IOException; + +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenIdentifier.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenIdentifier.java b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenIdentifier.java new file mode 100644 index 0000000..f0bb495 --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenIdentifier.java @@ -0,0 +1,82 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap.security; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +import org.apache.hadoop.classification.InterfaceAudience; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.security.token.Token; +import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier; + +/** For now, a LLAP token gives access to any LLAP server. */ +public class LlapTokenIdentifier extends AbstractDelegationTokenIdentifier { + private static final String KIND = "LLAP_TOKEN"; + public static final Text KIND_NAME = new Text(KIND); + + public LlapTokenIdentifier() { + super(); + } + + public LlapTokenIdentifier(Text owner, Text renewer, Text realUser) { + super(owner, renewer, realUser); + } + + @Override + public void write(DataOutput out) throws IOException { + super.write(out); + // Nothing right now. + } + + @Override + public void readFields(DataInput in) throws IOException { + super.readFields(in); + // Nothing right now. + } + + @Override + public Text getKind() { + return KIND_NAME; + } + + @Override + public int hashCode() { + return -1; + } + + @Override + public boolean equals(Object other) { + return (other != null) && other.getClass().isAssignableFrom(this.getClass()); + } + + @Override + public String toString() { + return KIND; + } + + @InterfaceAudience.Private + public static class Renewer extends Token.TrivialRenewer { + @Override + protected Text getKind() { + return KIND_NAME; + } + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenProvider.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenProvider.java b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenProvider.java new file mode 100644 index 0000000..2e99a28 --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenProvider.java @@ -0,0 +1,27 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap.security; + +import java.io.IOException; + +import org.apache.hadoop.security.token.Token; + +public interface LlapTokenProvider { + Token<LlapTokenIdentifier> getDelegationToken() throws IOException; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenSelector.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenSelector.java b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenSelector.java new file mode 100644 index 0000000..b6e7499 --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/security/LlapTokenSelector.java @@ -0,0 +1,53 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap.security; + +import java.util.Collection; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.io.Text; +import org.apache.hadoop.security.token.Token; +import org.apache.hadoop.security.token.TokenIdentifier; +import org.apache.hadoop.security.token.TokenSelector; + +public class LlapTokenSelector implements TokenSelector<LlapTokenIdentifier> { + private static final Log LOG = LogFactory.getLog(LlapTokenSelector.class); + + @Override + public Token<LlapTokenIdentifier> selectToken(Text service, + Collection<Token<? extends TokenIdentifier>> tokens) { + if (service == null) return null; + if (LOG.isDebugEnabled()) { + LOG.debug("Looking for a token with service " + service); + } + for (Token<? extends TokenIdentifier> token : tokens) { + if (LOG.isDebugEnabled()) { + LOG.debug("Token = " + token.getKind() + "; service = " + token.getService()); + } + if (LlapTokenIdentifier.KIND_NAME.equals(token.getKind()) + && service.equals(token.getService())) { + @SuppressWarnings("unchecked") + Token<LlapTokenIdentifier> result = (Token<LlapTokenIdentifier>)token; + return result; + } + } + return null; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/java/org/apache/hadoop/hive/llap/tez/Converters.java ---------------------------------------------------------------------- diff --git a/llap-common/src/java/org/apache/hadoop/hive/llap/tez/Converters.java b/llap-common/src/java/org/apache/hadoop/hive/llap/tez/Converters.java new file mode 100644 index 0000000..a5c3631 --- /dev/null +++ b/llap-common/src/java/org/apache/hadoop/hive/llap/tez/Converters.java @@ -0,0 +1,265 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.llap.tez; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.protobuf.ByteString; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.EntityDescriptorProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.GroupInputSpecProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.IOSpecProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.FragmentSpecProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SourceStateProto; +import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.UserPayloadProto; +import org.apache.tez.common.TezCommonUtils; +import org.apache.tez.dag.api.EntityDescriptor; +import org.apache.tez.dag.api.InputDescriptor; +import org.apache.tez.dag.api.OutputDescriptor; +import org.apache.tez.dag.api.ProcessorDescriptor; +import org.apache.tez.dag.api.TezUncheckedException; +import org.apache.tez.dag.api.UserPayload; +import org.apache.tez.dag.api.event.VertexState; +import org.apache.tez.dag.records.TezTaskAttemptID; +import org.apache.tez.runtime.api.impl.GroupInputSpec; +import org.apache.tez.runtime.api.impl.InputSpec; +import org.apache.tez.runtime.api.impl.OutputSpec; +import org.apache.tez.runtime.api.impl.TaskSpec; + +public class Converters { + + public static TaskSpec getTaskSpecfromProto(FragmentSpecProto FragmentSpecProto) { + TezTaskAttemptID taskAttemptID = + TezTaskAttemptID.fromString(FragmentSpecProto.getFragmentIdentifierString()); + + ProcessorDescriptor processorDescriptor = null; + if (FragmentSpecProto.hasProcessorDescriptor()) { + processorDescriptor = convertProcessorDescriptorFromProto( + FragmentSpecProto.getProcessorDescriptor()); + } + + List<InputSpec> inputSpecList = new ArrayList<InputSpec>(FragmentSpecProto.getInputSpecsCount()); + if (FragmentSpecProto.getInputSpecsCount() > 0) { + for (IOSpecProto inputSpecProto : FragmentSpecProto.getInputSpecsList()) { + inputSpecList.add(getInputSpecFromProto(inputSpecProto)); + } + } + + List<OutputSpec> outputSpecList = + new ArrayList<OutputSpec>(FragmentSpecProto.getOutputSpecsCount()); + if (FragmentSpecProto.getOutputSpecsCount() > 0) { + for (IOSpecProto outputSpecProto : FragmentSpecProto.getOutputSpecsList()) { + outputSpecList.add(getOutputSpecFromProto(outputSpecProto)); + } + } + + List<GroupInputSpec> groupInputSpecs = + new ArrayList<GroupInputSpec>(FragmentSpecProto.getGroupedInputSpecsCount()); + if (FragmentSpecProto.getGroupedInputSpecsCount() > 0) { + for (GroupInputSpecProto groupInputSpecProto : FragmentSpecProto.getGroupedInputSpecsList()) { + groupInputSpecs.add(getGroupInputSpecFromProto(groupInputSpecProto)); + } + } + + TaskSpec taskSpec = + new TaskSpec(taskAttemptID, FragmentSpecProto.getDagName(), FragmentSpecProto.getVertexName(), + FragmentSpecProto.getVertexParallelism(), processorDescriptor, inputSpecList, + outputSpecList, groupInputSpecs); + return taskSpec; + } + + public static FragmentSpecProto convertTaskSpecToProto(TaskSpec taskSpec) { + FragmentSpecProto.Builder builder = FragmentSpecProto.newBuilder(); + builder.setFragmentIdentifierString(taskSpec.getTaskAttemptID().toString()); + builder.setDagName(taskSpec.getDAGName()); + builder.setVertexName(taskSpec.getVertexName()); + builder.setVertexParallelism(taskSpec.getVertexParallelism()); + builder.setFragmentNumber(taskSpec.getTaskAttemptID().getTaskID().getId()); + builder.setAttemptNumber(taskSpec.getTaskAttemptID().getId()); + + if (taskSpec.getProcessorDescriptor() != null) { + builder.setProcessorDescriptor( + convertToProto(taskSpec.getProcessorDescriptor())); + } + + if (taskSpec.getInputs() != null && !taskSpec.getInputs().isEmpty()) { + for (InputSpec inputSpec : taskSpec.getInputs()) { + builder.addInputSpecs(convertInputSpecToProto(inputSpec)); + } + } + + if (taskSpec.getOutputs() != null && !taskSpec.getOutputs().isEmpty()) { + for (OutputSpec outputSpec : taskSpec.getOutputs()) { + builder.addOutputSpecs(convertOutputSpecToProto(outputSpec)); + } + } + + if (taskSpec.getGroupInputs() != null && !taskSpec.getGroupInputs().isEmpty()) { + for (GroupInputSpec groupInputSpec : taskSpec.getGroupInputs()) { + builder.addGroupedInputSpecs(convertGroupInputSpecToProto(groupInputSpec)); + + } + } + return builder.build(); + } + + private static ProcessorDescriptor convertProcessorDescriptorFromProto( + EntityDescriptorProto proto) { + String className = proto.getClassName(); + UserPayload payload = convertPayloadFromProto(proto); + ProcessorDescriptor pd = ProcessorDescriptor.create(className); + setUserPayload(pd, payload); + return pd; + } + + private static EntityDescriptorProto convertToProto( + EntityDescriptor<?> descriptor) { + EntityDescriptorProto.Builder builder = EntityDescriptorProto + .newBuilder(); + builder.setClassName(descriptor.getClassName()); + + UserPayload userPayload = descriptor.getUserPayload(); + if (userPayload != null) { + UserPayloadProto.Builder payloadBuilder = UserPayloadProto.newBuilder(); + if (userPayload.hasPayload()) { + payloadBuilder.setUserPayload(ByteString.copyFrom(userPayload.getPayload())); + payloadBuilder.setVersion(userPayload.getVersion()); + } + builder.setUserPayload(payloadBuilder.build()); + } + if (descriptor.getHistoryText() != null) { + try { + builder.setHistoryText(TezCommonUtils.compressByteArrayToByteString( + descriptor.getHistoryText().getBytes("UTF-8"))); + } catch (IOException e) { + throw new TezUncheckedException(e); + } + } + return builder.build(); + } + + private static InputSpec getInputSpecFromProto(IOSpecProto inputSpecProto) { + InputDescriptor inputDescriptor = null; + if (inputSpecProto.hasIoDescriptor()) { + inputDescriptor = + convertInputDescriptorFromProto(inputSpecProto.getIoDescriptor()); + } + InputSpec inputSpec = new InputSpec(inputSpecProto.getConnectedVertexName(), inputDescriptor, + inputSpecProto.getPhysicalEdgeCount()); + return inputSpec; + } + + private static InputDescriptor convertInputDescriptorFromProto( + EntityDescriptorProto proto) { + String className = proto.getClassName(); + UserPayload payload = convertPayloadFromProto(proto); + InputDescriptor id = InputDescriptor.create(className); + setUserPayload(id, payload); + return id; + } + + private static OutputDescriptor convertOutputDescriptorFromProto( + EntityDescriptorProto proto) { + String className = proto.getClassName(); + UserPayload payload = convertPayloadFromProto(proto); + OutputDescriptor od = OutputDescriptor.create(className); + setUserPayload(od, payload); + return od; + } + + private static IOSpecProto convertInputSpecToProto(InputSpec inputSpec) { + IOSpecProto.Builder builder = IOSpecProto.newBuilder(); + if (inputSpec.getSourceVertexName() != null) { + builder.setConnectedVertexName(inputSpec.getSourceVertexName()); + } + if (inputSpec.getInputDescriptor() != null) { + builder.setIoDescriptor(convertToProto(inputSpec.getInputDescriptor())); + } + builder.setPhysicalEdgeCount(inputSpec.getPhysicalEdgeCount()); + return builder.build(); + } + + private static OutputSpec getOutputSpecFromProto(IOSpecProto outputSpecProto) { + OutputDescriptor outputDescriptor = null; + if (outputSpecProto.hasIoDescriptor()) { + outputDescriptor = + convertOutputDescriptorFromProto(outputSpecProto.getIoDescriptor()); + } + OutputSpec outputSpec = + new OutputSpec(outputSpecProto.getConnectedVertexName(), outputDescriptor, + outputSpecProto.getPhysicalEdgeCount()); + return outputSpec; + } + + public static IOSpecProto convertOutputSpecToProto(OutputSpec outputSpec) { + IOSpecProto.Builder builder = IOSpecProto.newBuilder(); + if (outputSpec.getDestinationVertexName() != null) { + builder.setConnectedVertexName(outputSpec.getDestinationVertexName()); + } + if (outputSpec.getOutputDescriptor() != null) { + builder.setIoDescriptor(convertToProto(outputSpec.getOutputDescriptor())); + } + builder.setPhysicalEdgeCount(outputSpec.getPhysicalEdgeCount()); + return builder.build(); + } + + private static GroupInputSpec getGroupInputSpecFromProto(GroupInputSpecProto groupInputSpecProto) { + GroupInputSpec groupSpec = new GroupInputSpec(groupInputSpecProto.getGroupName(), + groupInputSpecProto.getGroupVerticesList(), + convertInputDescriptorFromProto(groupInputSpecProto.getMergedInputDescriptor())); + return groupSpec; + } + + private static GroupInputSpecProto convertGroupInputSpecToProto(GroupInputSpec groupInputSpec) { + GroupInputSpecProto.Builder builder = GroupInputSpecProto.newBuilder(); + builder.setGroupName(groupInputSpec.getGroupName()); + builder.addAllGroupVertices(groupInputSpec.getGroupVertices()); + builder.setMergedInputDescriptor(convertToProto(groupInputSpec.getMergedInputDescriptor())); + return builder.build(); + } + + + private static void setUserPayload(EntityDescriptor<?> entity, UserPayload payload) { + if (payload != null) { + entity.setUserPayload(payload); + } + } + + private static UserPayload convertPayloadFromProto( + EntityDescriptorProto proto) { + UserPayload userPayload = null; + if (proto.hasUserPayload()) { + if (proto.getUserPayload().hasUserPayload()) { + userPayload = + UserPayload.create(proto.getUserPayload().getUserPayload().asReadOnlyByteBuffer(), proto.getUserPayload().getVersion()); + } else { + userPayload = UserPayload.create(null); + } + } + return userPayload; + } + + public static SourceStateProto fromVertexState(VertexState state) { + switch (state) { + case SUCCEEDED: + return SourceStateProto.S_SUCCEEDED; + case RUNNING: + return SourceStateProto.S_RUNNING; + default: + throw new RuntimeException("Unexpected state: " + state); + } + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/protobuf/LlapDaemonProtocol.proto ---------------------------------------------------------------------- diff --git a/llap-common/src/protobuf/LlapDaemonProtocol.proto b/llap-common/src/protobuf/LlapDaemonProtocol.proto new file mode 100644 index 0000000..944c96c --- /dev/null +++ b/llap-common/src/protobuf/LlapDaemonProtocol.proto @@ -0,0 +1,148 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +option java_package = "org.apache.hadoop.hive.llap.daemon.rpc"; +option java_outer_classname = "LlapDaemonProtocolProtos"; +option java_generic_services = true; +option java_generate_equals_and_hash = true; + +// TODO Change this as the interface evolves. Currently using Tez constructs. + +message UserPayloadProto { + optional bytes user_payload = 1; + optional int32 version = 2; +} + +message EntityDescriptorProto { + optional string class_name = 1; + optional UserPayloadProto user_payload = 2; + optional bytes history_text = 3; +} + +message IOSpecProto { + optional string connected_vertex_name = 1; + optional EntityDescriptorProto io_descriptor = 2; + optional int32 physical_edge_count = 3; +} + +message GroupInputSpecProto { + optional string group_name = 1; + repeated string group_vertices = 2; + optional EntityDescriptorProto merged_input_descriptor = 3; +} + + +message FragmentSpecProto { + optional string fragment_identifier_string = 1; + optional string dag_name = 2; + optional int32 dag_id = 11; + optional string vertex_name = 3; + optional EntityDescriptorProto processor_descriptor = 4; + repeated IOSpecProto input_specs = 5; + repeated IOSpecProto output_specs = 6; + repeated GroupInputSpecProto grouped_input_specs = 7; + optional int32 vertex_parallelism = 8; + optional int32 fragment_number =9; + optional int32 attempt_number = 10; +} + +message FragmentRuntimeInfo { + optional int32 num_self_and_upstream_tasks = 1; + optional int32 num_self_and_upstream_completed_tasks = 2; + optional int32 within_dag_priority = 3; + optional int64 dag_start_time = 4; + optional int64 first_attempt_start_time = 5; + optional int64 current_attempt_start_time = 6; +} + +enum SourceStateProto { + S_SUCCEEDED = 1; + S_RUNNING = 2; +} + +message QueryIdentifierProto { + optional string app_identifier = 1; + optional int32 dag_identifier = 2; +} + +message SubmitWorkRequestProto { + optional string container_id_string = 1; + optional string am_host = 2; + optional int32 am_port = 3; + optional string token_identifier = 4; + optional bytes credentials_binary = 5; + optional string user = 6; + optional string application_id_string = 7; + optional int32 app_attempt_number = 8; + optional FragmentSpecProto fragment_spec = 9; + optional FragmentRuntimeInfo fragment_runtime_info = 10; +} + +enum SubmissionStateProto { + ACCEPTED = 1; + REJECTED = 2; + EVICTED_OTHER = 3; +} + +message SubmitWorkResponseProto { + optional SubmissionStateProto submission_state = 1; +} + +message SourceStateUpdatedRequestProto { + optional QueryIdentifierProto query_identifier = 1; + optional string src_name = 2; + optional SourceStateProto state = 3; +} + +message SourceStateUpdatedResponseProto { +} + +message QueryCompleteRequestProto { + optional string query_id = 1; + optional QueryIdentifierProto query_identifier = 2; + optional int64 delete_delay = 4 [default = 0]; +} + +message QueryCompleteResponseProto { +} + +message TerminateFragmentRequestProto { + optional QueryIdentifierProto query_identifier = 1; + optional string fragment_identifier_string = 2; +} + +message TerminateFragmentResponseProto { +} + +message GetTokenRequestProto { +} + +message GetTokenResponseProto { + optional bytes token = 1; +} + +service LlapDaemonProtocol { + rpc submitWork(SubmitWorkRequestProto) returns (SubmitWorkResponseProto); + rpc sourceStateUpdated(SourceStateUpdatedRequestProto) returns (SourceStateUpdatedResponseProto); + rpc queryComplete(QueryCompleteRequestProto) returns (QueryCompleteResponseProto); + rpc terminateFragment(TerminateFragmentRequestProto) returns (TerminateFragmentResponseProto); +} + +service LlapManagementProtocol { + rpc getDelegationToken(GetTokenRequestProto) returns (GetTokenResponseProto); +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-common/src/test/org/apache/hadoop/hive/llap/testhelpers/ControlledClock.java ---------------------------------------------------------------------- diff --git a/llap-common/src/test/org/apache/hadoop/hive/llap/testhelpers/ControlledClock.java b/llap-common/src/test/org/apache/hadoop/hive/llap/testhelpers/ControlledClock.java new file mode 100644 index 0000000..fec1c35 --- /dev/null +++ b/llap-common/src/test/org/apache/hadoop/hive/llap/testhelpers/ControlledClock.java @@ -0,0 +1,43 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.llap.testhelpers; + +import org.apache.hadoop.yarn.util.Clock; + +public class ControlledClock implements Clock { + private long time = -1; + private final Clock actualClock; + public ControlledClock(Clock actualClock) { + this.actualClock = actualClock; + } + public synchronized void setTime(long time) { + this.time = time; + } + public synchronized void reset() { + time = -1; + } + + @Override + public synchronized long getTime() { + if (time != -1) { + return time; + } + return actualClock.getTime(); + } + +} http://git-wip-us.apache.org/repos/asf/hive/blob/9886414b/llap-server/pom.xml ---------------------------------------------------------------------- diff --git a/llap-server/pom.xml b/llap-server/pom.xml index ab25f66..4011da0 100644 --- a/llap-server/pom.xml +++ b/llap-server/pom.xml @@ -32,7 +32,7 @@ </properties> <dependencies> - <!-- dependencies are always listed in sorted order by groupId, artifectId --> + <!-- dependencies are always listed in sorted order by groupId, artifactId --> <!-- intra-project --> <dependency> <groupId>org.apache.hive</groupId> @@ -46,11 +46,21 @@ </dependency> <dependency> <groupId>org.apache.hive</groupId> + <artifactId>hive-llap-common</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hive</groupId> <artifactId>hive-llap-client</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.hive</groupId> + <artifactId>hive-llap-tez</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hive</groupId> <artifactId>hive-shims</artifactId> <version>${project.version}</version> </dependency> @@ -90,77 +100,66 @@ <artifactId>hadoop-common</artifactId> <version>${hadoop.version}</version> <optional>true</optional> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - <exclusion> - <groupId>commmons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>commmons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-core</artifactId> <version>${hadoop.version}</version> <optional>true</optional> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - <exclusion> - <groupId>commmons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.tez</groupId> - <artifactId>tez-runtime-internals</artifactId> - <version>${tez.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - <exclusion> - <groupId>commmons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.tez</groupId> - <artifactId>tez-runtime-library</artifactId> - <version>${tez.version}</version> - <optional>true</optional> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>commmons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.tez</groupId> - <artifactId>tez-mapreduce</artifactId> + <artifactId>tez-runtime-internals</artifactId> <version>${tez.version}</version> <optional>true</optional> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - <exclusion> - <groupId>commmons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>commmons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.apache.tez</groupId> - <artifactId>tez-dag</artifactId> + <artifactId>tez-runtime-library</artifactId> <version>${tez.version}</version> <optional>true</optional> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>commmons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> </dependency> + <!-- test inter-project --> <dependency> <groupId>org.apache.hadoop</groupId> @@ -168,17 +167,17 @@ <version>${hadoop.version}</version> <classifier>tests</classifier> <scope>test</scope> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - <exclusion> - <groupId>commmons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>commmons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-hdfs</artifactId> @@ -225,15 +224,15 @@ <groupId>org.apache.hbase</groupId> <artifactId>hbase-server</artifactId> <version>${hbase.version}</version> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - <exclusion> - <groupId>commmons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + <exclusion> + <groupId>commmons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -248,54 +247,6 @@ </dependency> </dependencies> - <profiles> - <profile> - <id>protobuf</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>generate-protobuf-sources</id> - <phase>generate-sources</phase> - <configuration> - <target> - <property name="protobuf.src.dir" location="${basedir}/src/protobuf"/> - <property name="protobuf.build.dir" location="${basedir}/src/gen/protobuf/gen-java"/> - <echo>Building LLAP-Server Protobuf</echo> - <mkdir dir="${protobuf.build.dir}"/> - <exec executable="protoc" failonerror="true"> - <arg value="--java_out=${protobuf.build.dir}"/> - <arg value="-I=${protobuf.src.dir}"/> - <arg value="${protobuf.src.dir}/LlapDaemonProtocol.proto"/> - </exec> - </target> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> - - <build> <sourceDirectory>${basedir}/src/java</sourceDirectory> <testSourceDirectory>${basedir}/src/test</testSourceDirectory>