diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/AddPriorityLabelsToQueueRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/AddPriorityLabelsToQueueRequest.java new file mode 100644 index 0000000..61c19fe --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/AddPriorityLabelsToQueueRequest.java @@ -0,0 +1,54 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import java.util.Set; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class AddPriorityLabelsToQueueRequest { + public static AddPriorityLabelsToQueueRequest newInstance(String queueName, + Set labels) { + AddPriorityLabelsToQueueRequest request = + Records.newRecord(AddPriorityLabelsToQueueRequest.class); + request.setQueueName(queueName); + request.setPriorityLabels(labels); + return request; + } + + @Public + @Evolving + public abstract void setQueueName(String queueName); + + @Public + @Evolving + public abstract String getQueueName(); + + @Public + @Evolving + public abstract void setPriorityLabels(Set labels); + + @Public + @Evolving + public abstract Set getPriorityLabels(); +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/AddPriorityLabelsToQueueResponse.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/AddPriorityLabelsToQueueResponse.java new file mode 100644 index 0000000..3c6b92d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/AddPriorityLabelsToQueueResponse.java @@ -0,0 +1,31 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class AddPriorityLabelsToQueueResponse { + public static AddPriorityLabelsToQueueResponse newInstance() { + return Records.newRecord(AddPriorityLabelsToQueueResponse.class); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/GetPriorityLabelsRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/GetPriorityLabelsRequest.java new file mode 100644 index 0000000..defd784 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/GetPriorityLabelsRequest.java @@ -0,0 +1,50 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +public abstract class GetPriorityLabelsRequest { + public static GetPriorityLabelsRequest newInstance(String queueName, + String userName) { + GetPriorityLabelsRequest request = + Records.newRecord(GetPriorityLabelsRequest.class); + request.setQueueName(queueName); + request.setUserName(userName); + return request; + } + + @Public + @Evolving + public abstract void setQueueName(String queueName); + + @Public + @Evolving + public abstract String getQueueName(); + + @Public + @Evolving + public abstract void setUserName(String userName); + + @Public + @Evolving + public abstract String getUserName(); +} \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/GetPriorityLabelsResponse.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/GetPriorityLabelsResponse.java new file mode 100644 index 0000000..e9bca04 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/GetPriorityLabelsResponse.java @@ -0,0 +1,42 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import java.util.Set; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +public abstract class GetPriorityLabelsResponse { + public static GetPriorityLabelsResponse newInstance(Set priorityLabels) { + GetPriorityLabelsResponse response = + Records.newRecord(GetPriorityLabelsResponse.class); + response.setPriorityLabels(priorityLabels); + return response; + } + + @Public + @Evolving + public abstract void setPriorityLabels(Set priorityLabels); + + @Public + @Evolving + public abstract Set getPriorityLabels(); +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemoveFromClusterPriorityLabelsRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemoveFromClusterPriorityLabelsRequest.java new file mode 100644 index 0000000..c46404b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemoveFromClusterPriorityLabelsRequest.java @@ -0,0 +1,46 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import java.util.Collection; +import java.util.Set; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class RemoveFromClusterPriorityLabelsRequest { + public static RemoveFromClusterPriorityLabelsRequest newInstance( + Set labels) { + RemoveFromClusterPriorityLabelsRequest request = + Records.newRecord(RemoveFromClusterPriorityLabelsRequest.class); + request.setPriorityLabels(labels); + return request; + } + + @Public + @Evolving + public abstract void setPriorityLabels(Set labels); + + @Public + @Evolving + public abstract Collection getPriorityLabels(); +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemoveFromClusterPriorityLabelsResponse.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemoveFromClusterPriorityLabelsResponse.java new file mode 100644 index 0000000..b5d0a20 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemoveFromClusterPriorityLabelsResponse.java @@ -0,0 +1,31 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class RemoveFromClusterPriorityLabelsResponse { + public static RemoveFromClusterPriorityLabelsResponse newInstance() { + return Records.newRecord(RemoveFromClusterPriorityLabelsResponse.class); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemovePriorityLabelsFromQueueRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemovePriorityLabelsFromQueueRequest.java new file mode 100644 index 0000000..a7aac68 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemovePriorityLabelsFromQueueRequest.java @@ -0,0 +1,54 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import java.util.Set; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class RemovePriorityLabelsFromQueueRequest { + public static RemovePriorityLabelsFromQueueRequest newInstance( + String queueName, Set priortyLabels) { + RemovePriorityLabelsFromQueueRequest request = + Records.newRecord(RemovePriorityLabelsFromQueueRequest.class); + request.setQueueName(queueName); + request.setPriorityLabels(priortyLabels); + return request; + } + + @Public + @Evolving + public abstract void setQueueName(String queueName); + + @Public + @Evolving + public abstract String getQueueName(); + + @Public + @Evolving + public abstract void setPriorityLabels(Set priortyLabels); + + @Public + @Evolving + public abstract Set getPriorityLabels(); +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemovePriorityLabelsFromQueueResponse.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemovePriorityLabelsFromQueueResponse.java new file mode 100644 index 0000000..c46943a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RemovePriorityLabelsFromQueueResponse.java @@ -0,0 +1,31 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class RemovePriorityLabelsFromQueueResponse { + public static RemovePriorityLabelsFromQueueResponse newInstance() { + return Records.newRecord(RemovePriorityLabelsFromQueueResponse.class); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/ReplacePriorityLabelsOnQueueRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/ReplacePriorityLabelsOnQueueRequest.java new file mode 100644 index 0000000..41eb93e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/ReplacePriorityLabelsOnQueueRequest.java @@ -0,0 +1,46 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import java.util.Map; +import java.util.Set; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class ReplacePriorityLabelsOnQueueRequest { + public static ReplacePriorityLabelsOnQueueRequest newInstance( + Map> map) { + ReplacePriorityLabelsOnQueueRequest request = + Records.newRecord(ReplacePriorityLabelsOnQueueRequest.class); + request.setQueueToLabels(map); + return request; + } + + @Public + @Evolving + public abstract void setQueueToLabels(Map> map); + + @Public + @Evolving + public abstract Map> getQueueToLabels(); +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/ReplacePriorityLabelsOnQueueResponse.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/ReplacePriorityLabelsOnQueueResponse.java new file mode 100644 index 0000000..7335bd0 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/ReplacePriorityLabelsOnQueueResponse.java @@ -0,0 +1,31 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class ReplacePriorityLabelsOnQueueResponse { + public static ReplacePriorityLabelsOnQueueResponse newInstance() { + return Records.newRecord(ReplacePriorityLabelsOnQueueResponse.class); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/SetQueueAclToPriorityLabelRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/SetQueueAclToPriorityLabelRequest.java new file mode 100644 index 0000000..c1a536d --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/SetQueueAclToPriorityLabelRequest.java @@ -0,0 +1,63 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import java.util.Set; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class SetQueueAclToPriorityLabelRequest { + public static SetQueueAclToPriorityLabelRequest newInstance(String queueName, + String userName, Set userList) { + SetQueueAclToPriorityLabelRequest request = + Records.newRecord(SetQueueAclToPriorityLabelRequest.class); + request.setQueueName(queueName); + request.setPriorityLabelName(userName); + request.setQueuePriorityLabelACL(userList); + return request; + } + + @Public + @Evolving + public abstract void setQueueName(String queueName); + + @Public + @Evolving + public abstract String getQueueName(); + + @Public + @Evolving + public abstract void setPriorityLabelName(String userName); + + @Public + @Evolving + public abstract String getPriorityLabelName(); + + @Public + @Evolving + public abstract void setQueuePriorityLabelACL(Set userList); + + @Public + @Evolving + public abstract Set getQueuePriorityLabelACL(); +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/SetQueueAclToPriorityLabelResponse.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/SetQueueAclToPriorityLabelResponse.java new file mode 100644 index 0000000..0293c11 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/SetQueueAclToPriorityLabelResponse.java @@ -0,0 +1,31 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class SetQueueAclToPriorityLabelResponse { + public static SetQueueAclToPriorityLabelResponse newInstance() { + return Records.newRecord(SetQueueAclToPriorityLabelResponse.class); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/StorePriorityLabelsInClusterRequest.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/StorePriorityLabelsInClusterRequest.java new file mode 100644 index 0000000..ad5b39e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/StorePriorityLabelsInClusterRequest.java @@ -0,0 +1,44 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import java.util.Set; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class StorePriorityLabelsInClusterRequest { + public static StorePriorityLabelsInClusterRequest newInstance(Set priorityLabels) { + StorePriorityLabelsInClusterRequest request = + Records.newRecord(StorePriorityLabelsInClusterRequest.class); + request.setPriorityLabels(priorityLabels); + return request; + } + + @Public + @Evolving + public abstract void setPriorityLabels(Set priorityLabels); + + @Public + @Evolving + public abstract Set getPriorityLabels(); +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/StorePriorityLabelsInClusterResponse.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/StorePriorityLabelsInClusterResponse.java new file mode 100644 index 0000000..0dbd373 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/StorePriorityLabelsInClusterResponse.java @@ -0,0 +1,31 @@ +/** + * 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.yarn.server.api.protocolrecords; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Evolving; +import org.apache.hadoop.yarn.util.Records; + +@Public +@Evolving +public abstract class StorePriorityLabelsInClusterResponse { + public static StorePriorityLabelsInClusterResponse newInstance() { + return Records.newRecord(StorePriorityLabelsInClusterResponse.class); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/server/yarn_server_resourcemanager_service_protos.proto b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/server/yarn_server_resourcemanager_service_protos.proto index 900e349..78b0a46 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/server/yarn_server_resourcemanager_service_protos.proto +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/server/yarn_server_resourcemanager_service_protos.proto @@ -93,10 +93,66 @@ message ReplaceLabelsOnNodeRequestProto { repeated NodeIdToLabelsProto nodeToLabels = 1; } -message ReplaceLabelsOnNodeResponseProto { +message ReplaceLabelsOnNodeResponseProto { +} + +message AddPriorityLabelsToQueueRequestProto { + optional string queueName = 1; + repeated string priorityLabels = 2; +} + +message AddPriorityLabelsToQueueResponseProto { +} + +message StorePriorityLabelsInClusterRequestProto { + repeated string priorityLabels = 1; +} + +message StorePriorityLabelsInClusterResponseProto { +} + +message RemovePriorityLabelsFromQueueRequestProto { + optional string queueName = 1; + repeated string priorityLabels = 2; +} + +message RemovePriorityLabelsFromQueueResponseProto { +} + +message RemoveFromClusterPriorityLabelsRequestProto { + repeated string priorityLabels = 1; +} + +message RemoveFromClusterPriorityLabelsResponseProto { +} + +message ReplacePriorityLabelsOnQueueRequestProto { + repeated QueueToPriorityLabelsProto queueToPriorityLabels = 1; +} + +message ReplacePriorityLabelsOnQueueResponseProto { } +message GetPriorityLabelsRequestProto { + optional string queueName = 1; + optional string userName = 2; +} + +message GetPriorityLabelsResponseProto { + repeated string priorityLabels = 1; +} + +message SetQueueAclToPriorityLabelRequestProto { + optional string queueName = 1; + optional string priorityLabelName = 2; + repeated string queuePriorityLabelACL = 3; +} + +message SetQueueAclToPriorityLabelResponseProto { +} + + ////////////////////////////////////////////////////////////////// ///////////// RM Failover related records //////////////////////// ////////////////////////////////////////////////////////////////// diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto index c4e756d..52bfc2e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/yarn_protos.proto @@ -238,6 +238,11 @@ message NodeIdToLabelsProto { repeated string nodeLabels = 2; } +message QueueToPriorityLabelsProto { + optional string queueName = 1; + repeated string priorityLabels = 2; +} + //////////////////////////////////////////////////////////////////////// ////// From AM_RM_Protocol ///////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/AddPriorityLabelsToQueueRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/AddPriorityLabelsToQueueRequestPBImpl.java new file mode 100644 index 0000000..2dd88ec --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/AddPriorityLabelsToQueueRequestPBImpl.java @@ -0,0 +1,137 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.AddPriorityLabelsToQueueRequestProto; +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.AddPriorityLabelsToQueueRequestProtoOrBuilder; +import org.apache.hadoop.yarn.server.api.protocolrecords.AddPriorityLabelsToQueueRequest; + +public class AddPriorityLabelsToQueueRequestPBImpl extends + AddPriorityLabelsToQueueRequest { + AddPriorityLabelsToQueueRequestProto proto = + AddPriorityLabelsToQueueRequestProto.getDefaultInstance(); + AddPriorityLabelsToQueueRequestProto.Builder builder = null; + boolean viaProto = false; + + private Set priorityLabels = null; + + public AddPriorityLabelsToQueueRequestPBImpl() { + this.builder = AddPriorityLabelsToQueueRequestProto.newBuilder(); + } + + public AddPriorityLabelsToQueueRequestPBImpl( + AddPriorityLabelsToQueueRequestProto proto) { + this.proto = proto; + viaProto = true; + } + + private void maybeInitBuilder() { + if (viaProto || builder == null) { + builder = AddPriorityLabelsToQueueRequestProto.newBuilder(proto); + } + viaProto = false; + } + + private void mergeLocalToProto() { + if (viaProto) + maybeInitBuilder(); + mergeLocalToBuilder(); + proto = builder.build(); + viaProto = true; + } + + private void mergeLocalToBuilder() { + if (this.priorityLabels != null && !this.priorityLabels.isEmpty()) { + builder.clearPriorityLabels(); + builder.addAllPriorityLabels(this.priorityLabels); + } + } + + public AddPriorityLabelsToQueueRequestProto getProto() { + mergeLocalToProto(); + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public void setQueueName(String queueName) { + maybeInitBuilder(); + if (queueName == null) { + builder.clearQueueName(); + return; + } + builder.setQueueName(queueName); + } + + @Override + public String getQueueName() { + AddPriorityLabelsToQueueRequestProtoOrBuilder p = + viaProto ? proto : builder; + if (!p.hasQueueName()) { + return null; + } + return (p.getQueueName()); + } + + @Override + public void setPriorityLabels(Set priorityLabels) { + maybeInitBuilder(); + if (priorityLabels == null || priorityLabels.isEmpty()) { + builder.clearPriorityLabels(); + ; + } + this.priorityLabels = priorityLabels; + } + + private void initPriorityLabel() { + if (this.priorityLabels != null) { + return; + } + AddPriorityLabelsToQueueRequestProtoOrBuilder p = + viaProto ? proto : builder; + this.priorityLabels = new HashSet(); + this.priorityLabels.addAll(p.getPriorityLabelsList()); + } + + @Override + public Set getPriorityLabels() { + initPriorityLabel(); + return this.priorityLabels; + } + + @Override + public int hashCode() { + assert false : "hashCode not designed"; + return 0; + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/AddPriorityLabelsToQueueResponsePBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/AddPriorityLabelsToQueueResponsePBImpl.java new file mode 100644 index 0000000..b97a87a --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/AddPriorityLabelsToQueueResponsePBImpl.java @@ -0,0 +1,69 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.AddPriorityLabelsToQueueResponseProto; +import org.apache.hadoop.yarn.server.api.protocolrecords.AddPriorityLabelsToQueueResponse; + +import com.google.protobuf.TextFormat; + +public class AddPriorityLabelsToQueueResponsePBImpl extends + AddPriorityLabelsToQueueResponse { + + AddPriorityLabelsToQueueResponseProto proto = + AddPriorityLabelsToQueueResponseProto.getDefaultInstance(); + AddPriorityLabelsToQueueResponseProto.Builder builder = null; + boolean viaProto = false; + + public AddPriorityLabelsToQueueResponsePBImpl() { + builder = AddPriorityLabelsToQueueResponseProto.newBuilder(); + } + + public AddPriorityLabelsToQueueResponsePBImpl( + AddPriorityLabelsToQueueResponseProto proto) { + this.proto = proto; + viaProto = true; + } + + public AddPriorityLabelsToQueueResponseProto getProto() { + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public int hashCode() { + return getProto().hashCode(); + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } + + @Override + public String toString() { + return TextFormat.shortDebugString(getProto()); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/GetPriorityLabelsRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/GetPriorityLabelsRequestPBImpl.java new file mode 100644 index 0000000..150080c --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/GetPriorityLabelsRequestPBImpl.java @@ -0,0 +1,113 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.GetPriorityLabelsRequestProto; +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.GetPriorityLabelsRequestProtoOrBuilder; +import org.apache.hadoop.yarn.server.api.protocolrecords.GetPriorityLabelsRequest; + +import com.google.protobuf.TextFormat; + +public class GetPriorityLabelsRequestPBImpl extends GetPriorityLabelsRequest { + + GetPriorityLabelsRequestProto proto = GetPriorityLabelsRequestProto + .getDefaultInstance(); + GetPriorityLabelsRequestProto.Builder builder = null; + boolean viaProto = false; + + public GetPriorityLabelsRequestPBImpl() { + builder = GetPriorityLabelsRequestProto.newBuilder(); + } + + public GetPriorityLabelsRequestPBImpl(GetPriorityLabelsRequestProto proto) { + this.proto = proto; + viaProto = true; + } + + public GetPriorityLabelsRequestProto getProto() { + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + private void maybeInitBuilder() { + if (viaProto || builder == null) { + builder = GetPriorityLabelsRequestProto.newBuilder(proto); + } + viaProto = false; + } + + @Override + public void setQueueName(String queueName) { + maybeInitBuilder(); + if (queueName == null) { + builder.clearQueueName(); + return; + } + builder.setQueueName(queueName); + } + + @Override + public String getQueueName() { + GetPriorityLabelsRequestProtoOrBuilder p = viaProto ? proto : builder; + if (!p.hasQueueName()) { + return null; + } + return (p.getQueueName()); + } + + @Override + public void setUserName(String userName) { + maybeInitBuilder(); + if (userName == null) { + builder.clearUserName(); + return; + } + builder.setUserName(userName); + } + + @Override + public String getUserName() { + GetPriorityLabelsRequestProtoOrBuilder p = viaProto ? proto : builder; + if (!p.hasUserName()) { + return null; + } + return (p.getUserName()); + } + + @Override + public int hashCode() { + return getProto().hashCode(); + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } + + @Override + public String toString() { + return TextFormat.shortDebugString(getProto()); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/GetPriorityLabelsResponsePBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/GetPriorityLabelsResponsePBImpl.java new file mode 100644 index 0000000..1d43e0e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/GetPriorityLabelsResponsePBImpl.java @@ -0,0 +1,114 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.GetPriorityLabelsResponseProto; +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.GetPriorityLabelsResponseProtoOrBuilder; +import org.apache.hadoop.yarn.server.api.protocolrecords.GetPriorityLabelsResponse; + +public class GetPriorityLabelsResponsePBImpl extends GetPriorityLabelsResponse { + GetPriorityLabelsResponseProto proto = GetPriorityLabelsResponseProto + .getDefaultInstance(); + GetPriorityLabelsResponseProto.Builder builder = null; + boolean viaProto = false; + + private Set priorityLabels = null; + + public GetPriorityLabelsResponsePBImpl() { + this.builder = GetPriorityLabelsResponseProto.newBuilder(); + } + + public GetPriorityLabelsResponsePBImpl(GetPriorityLabelsResponseProto proto) { + this.proto = proto; + viaProto = true; + } + + private void maybeInitBuilder() { + if (viaProto || builder == null) { + builder = GetPriorityLabelsResponseProto.newBuilder(proto); + } + viaProto = false; + } + + private void mergeLocalToProto() { + if (viaProto) + maybeInitBuilder(); + mergeLocalToBuilder(); + proto = builder.build(); + viaProto = true; + } + + private void mergeLocalToBuilder() { + if (this.priorityLabels != null && !this.priorityLabels.isEmpty()) { + builder.clearPriorityLabels(); + builder.addAllPriorityLabels(this.priorityLabels); + } + } + + public GetPriorityLabelsResponseProto getProto() { + mergeLocalToProto(); + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public void setPriorityLabels(Set priorityLabels) { + maybeInitBuilder(); + if (priorityLabels == null || priorityLabels.isEmpty()) { + builder.clearPriorityLabels(); + ; + } + this.priorityLabels = priorityLabels; + } + + private void initPriorityLabel() { + if (this.priorityLabels != null) { + return; + } + GetPriorityLabelsResponseProtoOrBuilder p = viaProto ? proto : builder; + this.priorityLabels = new HashSet(); + this.priorityLabels.addAll(p.getPriorityLabelsList()); + } + + @Override + public Set getPriorityLabels() { + initPriorityLabel(); + return this.priorityLabels; + } + + @Override + public int hashCode() { + assert false : "hashCode not designed"; + return 0; + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemoveFromClusterPriorityLabelsRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemoveFromClusterPriorityLabelsRequestPBImpl.java new file mode 100644 index 0000000..0598134 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemoveFromClusterPriorityLabelsRequestPBImpl.java @@ -0,0 +1,115 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RemoveFromClusterPriorityLabelsRequestProto; +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RemoveFromClusterPriorityLabelsRequestProtoOrBuilder; +import org.apache.hadoop.yarn.server.api.protocolrecords.RemoveFromClusterPriorityLabelsRequest; + +public class RemoveFromClusterPriorityLabelsRequestPBImpl extends + RemoveFromClusterPriorityLabelsRequest { + Set priorityLabels; + RemoveFromClusterPriorityLabelsRequestProto proto = + RemoveFromClusterPriorityLabelsRequestProto.getDefaultInstance(); + RemoveFromClusterPriorityLabelsRequestProto.Builder builder = null; + boolean viaProto = false; + + public RemoveFromClusterPriorityLabelsRequestPBImpl() { + this.builder = RemoveFromClusterPriorityLabelsRequestProto.newBuilder(); + } + + public RemoveFromClusterPriorityLabelsRequestPBImpl( + RemoveFromClusterPriorityLabelsRequestProto proto) { + this.proto = proto; + viaProto = true; + } + + private void maybeInitBuilder() { + if (viaProto || builder == null) { + builder = RemoveFromClusterPriorityLabelsRequestProto.newBuilder(proto); + } + viaProto = false; + } + + private void mergeLocalToBuilder() { + if (this.priorityLabels != null && !this.priorityLabels.isEmpty()) { + builder.clearPriorityLabels(); + builder.addAllPriorityLabels(this.priorityLabels); + } + } + + private void mergeLocalToProto() { + if (viaProto) + maybeInitBuilder(); + mergeLocalToBuilder(); + proto = builder.build(); + viaProto = true; + } + + public RemoveFromClusterPriorityLabelsRequestProto getProto() { + mergeLocalToProto(); + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + private void initPriorityLabels() { + if (this.priorityLabels != null) { + return; + } + RemoveFromClusterPriorityLabelsRequestProtoOrBuilder p = + viaProto ? proto : builder; + this.priorityLabels = new HashSet(); + this.priorityLabels.addAll(p.getPriorityLabelsList()); + } + + @Override + public void setPriorityLabels(Set priorityLabels) { + maybeInitBuilder(); + if (priorityLabels == null || priorityLabels.isEmpty()) { + builder.clearPriorityLabels(); + } + this.priorityLabels = priorityLabels; + } + + @Override + public Set getPriorityLabels() { + initPriorityLabels(); + return this.priorityLabels; + } + + @Override + public int hashCode() { + assert false : "hashCode not designed"; + return 0; + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemoveFromClusterPriorityLabelsResponsePBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemoveFromClusterPriorityLabelsResponsePBImpl.java new file mode 100644 index 0000000..66778e7 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemoveFromClusterPriorityLabelsResponsePBImpl.java @@ -0,0 +1,69 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RemoveFromClusterNodeLabelsResponseProto; +import org.apache.hadoop.yarn.server.api.protocolrecords.RemoveFromClusterNodeLabelsResponse; + +import com.google.protobuf.TextFormat; + +public class RemoveFromClusterPriorityLabelsResponsePBImpl extends + RemoveFromClusterNodeLabelsResponse { + + RemoveFromClusterNodeLabelsResponseProto proto = + RemoveFromClusterNodeLabelsResponseProto.getDefaultInstance(); + RemoveFromClusterNodeLabelsResponseProto.Builder builder = null; + boolean viaProto = false; + + public RemoveFromClusterPriorityLabelsResponsePBImpl() { + builder = RemoveFromClusterNodeLabelsResponseProto.newBuilder(); + } + + public RemoveFromClusterPriorityLabelsResponsePBImpl( + RemoveFromClusterNodeLabelsResponseProto proto) { + this.proto = proto; + viaProto = true; + } + + public RemoveFromClusterNodeLabelsResponseProto getProto() { + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public int hashCode() { + return getProto().hashCode(); + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } + + @Override + public String toString() { + return TextFormat.shortDebugString(getProto()); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemovePriorityLabelsFromQueueRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemovePriorityLabelsFromQueueRequestPBImpl.java new file mode 100644 index 0000000..93a6572 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemovePriorityLabelsFromQueueRequestPBImpl.java @@ -0,0 +1,136 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RemovePriorityLabelsFromQueueRequestProto; +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RemovePriorityLabelsFromQueueRequestProtoOrBuilder; +import org.apache.hadoop.yarn.server.api.protocolrecords.RemovePriorityLabelsFromQueueRequest; + +public class RemovePriorityLabelsFromQueueRequestPBImpl extends + RemovePriorityLabelsFromQueueRequest { + RemovePriorityLabelsFromQueueRequestProto proto = + RemovePriorityLabelsFromQueueRequestProto.getDefaultInstance(); + RemovePriorityLabelsFromQueueRequestProto.Builder builder = null; + boolean viaProto = false; + + private Set priorityLabels = null; + + public RemovePriorityLabelsFromQueueRequestPBImpl() { + this.builder = RemovePriorityLabelsFromQueueRequestProto.newBuilder(); + } + + public RemovePriorityLabelsFromQueueRequestPBImpl( + RemovePriorityLabelsFromQueueRequestProto proto) { + this.proto = proto; + viaProto = true; + } + + private void maybeInitBuilder() { + if (viaProto || builder == null) { + builder = RemovePriorityLabelsFromQueueRequestProto.newBuilder(proto); + } + viaProto = false; + } + + private void mergeLocalToProto() { + if (viaProto) + maybeInitBuilder(); + mergeLocalToBuilder(); + proto = builder.build(); + viaProto = true; + } + + private void mergeLocalToBuilder() { + if (this.priorityLabels != null && !this.priorityLabels.isEmpty()) { + builder.clearPriorityLabels(); + builder.addAllPriorityLabels(this.priorityLabels); + } + } + + public RemovePriorityLabelsFromQueueRequestProto getProto() { + mergeLocalToProto(); + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public void setQueueName(String queueName) { + maybeInitBuilder(); + if (queueName == null) { + builder.clearQueueName(); + return; + } + builder.setQueueName(queueName); + } + + @Override + public String getQueueName() { + RemovePriorityLabelsFromQueueRequestProtoOrBuilder p = + viaProto ? proto : builder; + if (!p.hasQueueName()) { + return null; + } + return (p.getQueueName()); + } + + @Override + public void setPriorityLabels(Set priorityLabels) { + maybeInitBuilder(); + if (priorityLabels == null || priorityLabels.isEmpty()) { + builder.clearPriorityLabels(); + } + this.priorityLabels = priorityLabels; + } + + private void initPriorityLabel() { + if (this.priorityLabels != null) { + return; + } + RemovePriorityLabelsFromQueueRequestProtoOrBuilder p = + viaProto ? proto : builder; + this.priorityLabels = new HashSet(); + this.priorityLabels.addAll(p.getPriorityLabelsList()); + } + + @Override + public Set getPriorityLabels() { + initPriorityLabel(); + return this.priorityLabels; + } + + @Override + public int hashCode() { + assert false : "hashCode not designed"; + return 0; + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemovePriorityLabelsFromQueueResponsePBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemovePriorityLabelsFromQueueResponsePBImpl.java new file mode 100644 index 0000000..a41b7bc --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RemovePriorityLabelsFromQueueResponsePBImpl.java @@ -0,0 +1,69 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RemoveFromClusterNodeLabelsResponseProto; +import org.apache.hadoop.yarn.server.api.protocolrecords.RemovePriorityLabelsFromQueueResponse; + +import com.google.protobuf.TextFormat; + +public class RemovePriorityLabelsFromQueueResponsePBImpl extends + RemovePriorityLabelsFromQueueResponse { + + RemoveFromClusterNodeLabelsResponseProto proto = + RemoveFromClusterNodeLabelsResponseProto.getDefaultInstance(); + RemoveFromClusterNodeLabelsResponseProto.Builder builder = null; + boolean viaProto = false; + + public RemovePriorityLabelsFromQueueResponsePBImpl() { + builder = RemoveFromClusterNodeLabelsResponseProto.newBuilder(); + } + + public RemovePriorityLabelsFromQueueResponsePBImpl( + RemoveFromClusterNodeLabelsResponseProto proto) { + this.proto = proto; + viaProto = true; + } + + public RemoveFromClusterNodeLabelsResponseProto getProto() { + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public int hashCode() { + return getProto().hashCode(); + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } + + @Override + public String toString() { + return TextFormat.shortDebugString(getProto()); + } +} \ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/ReplacePriorityLabelsOnQueueRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/ReplacePriorityLabelsOnQueueRequestPBImpl.java new file mode 100644 index 0000000..505382b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/ReplacePriorityLabelsOnQueueRequestPBImpl.java @@ -0,0 +1,163 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.apache.hadoop.yarn.proto.YarnProtos.QueueToPriorityLabelsProto; +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.ReplacePriorityLabelsOnQueueRequestProto; +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.ReplacePriorityLabelsOnQueueRequestProtoOrBuilder; +import org.apache.hadoop.yarn.server.api.protocolrecords.ReplacePriorityLabelsOnQueueRequest; + +import com.google.common.collect.Sets; + +public class ReplacePriorityLabelsOnQueueRequestPBImpl extends + ReplacePriorityLabelsOnQueueRequest { + ReplacePriorityLabelsOnQueueRequestProto proto = ReplacePriorityLabelsOnQueueRequestProto + .getDefaultInstance(); + ReplacePriorityLabelsOnQueueRequestProto.Builder builder = null; + boolean viaProto = false; + + private Map> queueNameToLabels; + + public ReplacePriorityLabelsOnQueueRequestPBImpl() { + this.builder = ReplacePriorityLabelsOnQueueRequestProto.newBuilder(); + } + + public ReplacePriorityLabelsOnQueueRequestPBImpl( + ReplacePriorityLabelsOnQueueRequestProto proto) { + this.proto = proto; + this.viaProto = true; + } + + private void initQueueToLabels() { + if (this.queueNameToLabels != null) { + return; + } + ReplacePriorityLabelsOnQueueRequestProtoOrBuilder p = viaProto ? proto + : builder; + List list = p.getQueueToPriorityLabelsList(); + this.queueNameToLabels = new HashMap>(); + + for (QueueToPriorityLabelsProto c : list) { + this.queueNameToLabels.put(c.getQueueName(), + Sets.newHashSet(c.getPriorityLabelsList())); + } + } + + private void maybeInitBuilder() { + if (viaProto || builder == null) { + builder = ReplacePriorityLabelsOnQueueRequestProto.newBuilder(proto); + } + viaProto = false; + } + + private void addQueueToLabelsToProto() { + maybeInitBuilder(); + builder.clearQueueToPriorityLabels(); + if (queueNameToLabels == null) { + return; + } + + Iterable iterable = new Iterable() { + @Override + public Iterator iterator() { + return new Iterator() { + + Iterator>> iter = queueNameToLabels + .entrySet().iterator(); + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + @Override + public QueueToPriorityLabelsProto next() { + Entry> now = iter.next(); + return QueueToPriorityLabelsProto.newBuilder() + .setQueueName(now.getKey()).clearPriorityLabels() + .addAllPriorityLabels(now.getValue()).build(); + } + + @Override + public boolean hasNext() { + return iter.hasNext(); + } + }; + } + }; + builder.addAllQueueToPriorityLabels(iterable); + } + + private void mergeLocalToBuilder() { + if (this.queueNameToLabels != null) { + addQueueToLabelsToProto(); + } + } + + private void mergeLocalToProto() { + if (viaProto) + maybeInitBuilder(); + mergeLocalToBuilder(); + proto = builder.build(); + viaProto = true; + } + + public ReplacePriorityLabelsOnQueueRequestProto getProto() { + mergeLocalToProto(); + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public Map> getQueueToLabels() { + initQueueToLabels(); + return this.queueNameToLabels; + } + + @Override + public void setQueueToLabels(Map> map) { + initQueueToLabels(); + queueNameToLabels.clear(); + queueNameToLabels.putAll(map); + } + + @Override + public int hashCode() { + assert false : "hashCode not designed"; + return 0; + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/ReplacePriorityLabelsOnQueueResponsePBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/ReplacePriorityLabelsOnQueueResponsePBImpl.java new file mode 100644 index 0000000..abc930b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/ReplacePriorityLabelsOnQueueResponsePBImpl.java @@ -0,0 +1,69 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.ReplacePriorityLabelsOnQueueResponseProto; +import org.apache.hadoop.yarn.server.api.protocolrecords.ReplacePriorityLabelsOnQueueResponse; + +import com.google.protobuf.TextFormat; + +public class ReplacePriorityLabelsOnQueueResponsePBImpl extends + ReplacePriorityLabelsOnQueueResponse { + + ReplacePriorityLabelsOnQueueResponseProto proto = ReplacePriorityLabelsOnQueueResponseProto + .getDefaultInstance(); + ReplacePriorityLabelsOnQueueResponseProto.Builder builder = null; + boolean viaProto = false; + + public ReplacePriorityLabelsOnQueueResponsePBImpl() { + builder = ReplacePriorityLabelsOnQueueResponseProto.newBuilder(); + } + + public ReplacePriorityLabelsOnQueueResponsePBImpl( + ReplacePriorityLabelsOnQueueResponseProto proto) { + this.proto = proto; + viaProto = true; + } + + public ReplacePriorityLabelsOnQueueResponseProto getProto() { + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public int hashCode() { + return getProto().hashCode(); + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } + + @Override + public String toString() { + return TextFormat.shortDebugString(getProto()); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/SetQueueAclToPriorityLabelRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/SetQueueAclToPriorityLabelRequestPBImpl.java new file mode 100644 index 0000000..a59217b --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/SetQueueAclToPriorityLabelRequestPBImpl.java @@ -0,0 +1,126 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import java.util.Set; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.SetQueueAclToPriorityLabelRequestProto; +import org.apache.hadoop.yarn.server.api.protocolrecords.SetQueueAclToPriorityLabelRequest; + +public class SetQueueAclToPriorityLabelRequestPBImpl extends + SetQueueAclToPriorityLabelRequest { + SetQueueAclToPriorityLabelRequestProto proto = + SetQueueAclToPriorityLabelRequestProto.getDefaultInstance(); + SetQueueAclToPriorityLabelRequestProto.Builder builder = null; + boolean viaProto = false; + + Set userLists = null; + + public SetQueueAclToPriorityLabelRequestPBImpl() { + this.builder = SetQueueAclToPriorityLabelRequestProto.newBuilder(); + } + + public SetQueueAclToPriorityLabelRequestPBImpl( + SetQueueAclToPriorityLabelRequestProto proto) { + this.proto = proto; + viaProto = true; + } + + private void maybeInitBuilder() { + if (viaProto || builder == null) { + builder = SetQueueAclToPriorityLabelRequestProto.newBuilder(proto); + } + viaProto = false; + } + + private void mergeLocalToProto() { + if (viaProto) + maybeInitBuilder(); + mergeLocalToBuilder(); + proto = builder.build(); + viaProto = true; + } + + private void mergeLocalToBuilder() { + if (this.userLists != null && !this.userLists.isEmpty()) { + builder.clearQueuePriorityLabelACL(); + builder.addAllQueuePriorityLabelACL(this.userLists); + } + } + + public SetQueueAclToPriorityLabelRequestProto getProto() { + mergeLocalToProto(); + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public int hashCode() { + assert false : "hashCode not designed"; + return 0; + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } + + @Override + public void setQueueName(String queueName) { + // TODO Auto-generated method stub + + } + + @Override + public String getQueueName() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setPriorityLabelName(String userName) { + // TODO Auto-generated method stub + + } + + @Override + public String getPriorityLabelName() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setQueuePriorityLabelACL(Set userList) { + // TODO Auto-generated method stub + + } + + @Override + public Set getQueuePriorityLabelACL() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/SetQueueAclToPriorityLabelResponsePBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/SetQueueAclToPriorityLabelResponsePBImpl.java new file mode 100644 index 0000000..10b241e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/SetQueueAclToPriorityLabelResponsePBImpl.java @@ -0,0 +1,69 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.SetQueueAclToPriorityLabelResponseProto; +import org.apache.hadoop.yarn.server.api.protocolrecords.SetQueueAclToPriorityLabelResponse; + +import com.google.protobuf.TextFormat; + +public class SetQueueAclToPriorityLabelResponsePBImpl extends + SetQueueAclToPriorityLabelResponse { + + SetQueueAclToPriorityLabelResponseProto proto = + SetQueueAclToPriorityLabelResponseProto.getDefaultInstance(); + SetQueueAclToPriorityLabelResponseProto.Builder builder = null; + boolean viaProto = false; + + public SetQueueAclToPriorityLabelResponsePBImpl() { + builder = SetQueueAclToPriorityLabelResponseProto.newBuilder(); + } + + public SetQueueAclToPriorityLabelResponsePBImpl( + SetQueueAclToPriorityLabelResponseProto proto) { + this.proto = proto; + viaProto = true; + } + + public SetQueueAclToPriorityLabelResponseProto getProto() { + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public int hashCode() { + return getProto().hashCode(); + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } + + @Override + public String toString() { + return TextFormat.shortDebugString(getProto()); + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/StorePriorityLabelsInClusterRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/StorePriorityLabelsInClusterRequestPBImpl.java new file mode 100644 index 0000000..67794da --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/StorePriorityLabelsInClusterRequestPBImpl.java @@ -0,0 +1,115 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.StorePriorityLabelsInClusterRequestProto; +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.StorePriorityLabelsInClusterRequestProtoOrBuilder; +import org.apache.hadoop.yarn.server.api.protocolrecords.StorePriorityLabelsInClusterRequest; + +public class StorePriorityLabelsInClusterRequestPBImpl extends + StorePriorityLabelsInClusterRequest { + Set labels; + StorePriorityLabelsInClusterRequestProto proto = StorePriorityLabelsInClusterRequestProto + .getDefaultInstance(); + StorePriorityLabelsInClusterRequestProto.Builder builder = null; + boolean viaProto = false; + + public StorePriorityLabelsInClusterRequestPBImpl() { + this.builder = StorePriorityLabelsInClusterRequestProto.newBuilder(); + } + + public StorePriorityLabelsInClusterRequestPBImpl( + StorePriorityLabelsInClusterRequestProto proto) { + this.proto = proto; + viaProto = true; + } + + private void maybeInitBuilder() { + if (viaProto || builder == null) { + builder = StorePriorityLabelsInClusterRequestProto.newBuilder(proto); + } + viaProto = false; + } + + private void mergeLocalToBuilder() { + if (this.labels != null && !this.labels.isEmpty()) { + builder.clearPriorityLabels(); + builder.addAllPriorityLabels(this.labels); + } + } + + private void mergeLocalToProto() { + if (viaProto) + maybeInitBuilder(); + mergeLocalToBuilder(); + proto = builder.build(); + viaProto = true; + } + + public StorePriorityLabelsInClusterRequestProto getProto() { + mergeLocalToProto(); + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + private void initLabels() { + if (this.labels != null) { + return; + } + StorePriorityLabelsInClusterRequestProtoOrBuilder p = viaProto ? proto + : builder; + this.labels = new HashSet(); + this.labels.addAll(p.getPriorityLabelsList()); + } + + @Override + public void setPriorityLabels(Set labels) { + maybeInitBuilder(); + if (labels == null || labels.isEmpty()) { + builder.clearPriorityLabels(); + } + this.labels = labels; + } + + @Override + public Set getPriorityLabels() { + initLabels(); + return this.labels; + } + + @Override + public int hashCode() { + assert false : "hashCode not designed"; + return 0; + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } +} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/StorePriorityLabelsInClusterResponsePBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/StorePriorityLabelsInClusterResponsePBImpl.java new file mode 100644 index 0000000..d353b8e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/StorePriorityLabelsInClusterResponsePBImpl.java @@ -0,0 +1,69 @@ +/** + * 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.yarn.server.api.protocolrecords.impl.pb; + +import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.StorePriorityLabelsInClusterResponseProto; +import org.apache.hadoop.yarn.server.api.protocolrecords.StorePriorityLabelsInClusterResponse; + +import com.google.protobuf.TextFormat; + +public class StorePriorityLabelsInClusterResponsePBImpl extends + StorePriorityLabelsInClusterResponse { + + StorePriorityLabelsInClusterResponseProto proto = StorePriorityLabelsInClusterResponseProto + .getDefaultInstance(); + StorePriorityLabelsInClusterResponseProto.Builder builder = null; + boolean viaProto = false; + + public StorePriorityLabelsInClusterResponsePBImpl() { + builder = StorePriorityLabelsInClusterResponseProto.newBuilder(); + } + + public StorePriorityLabelsInClusterResponsePBImpl( + StorePriorityLabelsInClusterResponseProto proto) { + this.proto = proto; + viaProto = true; + } + + public StorePriorityLabelsInClusterResponseProto getProto() { + proto = viaProto ? proto : builder.build(); + viaProto = true; + return proto; + } + + @Override + public int hashCode() { + return getProto().hashCode(); + } + + @Override + public boolean equals(Object other) { + if (other == null) + return false; + if (other.getClass().isAssignableFrom(this.getClass())) { + return this.getProto().equals(this.getClass().cast(other).getProto()); + } + return false; + } + + @Override + public String toString() { + return TextFormat.shortDebugString(getProto()); + } +} -- 1.9.4.msysgit.1