hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (HDDS-1469) Generate default configuration fragments based on annotations
Date Thu, 25 Apr 2019 19:35:01 GMT

     [ https://issues.apache.org/jira/browse/HDDS-1469?focusedWorklogId=233062&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-233062
]

ASF GitHub Bot logged work on HDDS-1469:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Apr/19 19:34
            Start Date: 25/Apr/19 19:34
    Worklog Time Spent: 10m 
      Work Description: anuengineer commented on pull request #773: HDDS-1469. Generate default
configuration fragments based on annotations
URL: https://github.com/apache/hadoop/pull/773#discussion_r278697984
 
 

 ##########
 File path: hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/ConfigFileGenerator.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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.hdds.conf;
+
+import javax.annotation.processing.AbstractProcessor;
+import javax.annotation.processing.Filer;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.element.TypeElement;
+import javax.tools.Diagnostic.Kind;
+import javax.tools.FileObject;
+import javax.tools.StandardLocation;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.nio.charset.StandardCharsets;
+import java.util.Set;
+
+/**
+ * Annotation processor to generate ozone-site-generated fragments from
+ * ozone-site.xml.
+ */
+@SupportedAnnotationTypes("org.apache.hadoop.hdds.conf.ConfigGroup")
+public class ConfigFileGenerator extends AbstractProcessor {
+
+  public static final String OUTPUT_FILE_NAME = "ozone-default-generated.xml";
+
+  @Override
+  public boolean process(Set<? extends TypeElement> annotations,
+      RoundEnvironment roundEnv) {
+    if (roundEnv.processingOver()) {
+      return false;
+    }
+
+    Filer filer = processingEnv.getFiler();
+    System.out.println("round");
 
 Review comment:
   Debug?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 233062)
    Time Spent: 1h 10m  (was: 1h)

> Generate default configuration fragments based on annotations
> -------------------------------------------------------------
>
>                 Key: HDDS-1469
>                 URL: https://issues.apache.org/jira/browse/HDDS-1469
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Elek, Marton
>            Assignee: Elek, Marton
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> See the design doc in the parent jira for more details.
> In this jira I introduce a new annotation processor which can generate ozone-default.xml
fragments based on the annotations which are introduced by HDDS-1468.
> The ozone-default-generated.xml fragments can be used directly by the OzoneConfiguration
as I added a small code to the constructor to check ALL the available ozone-default-generated.xml
files and add them to the available resources.
> With this approach we don't need to edit ozone-default.xml as all the configuration can
be defined in java code.
> As a side effect each service will see only the available configuration keys and values
based on the classpath. (If the ozone-default-generated.xml file of OzoneManager is not on
the classpath of the SCM, SCM doesn't see the available configs.) 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message