You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/10/13 22:46:13 UTC

[GitHub] [incubator-pinot] jackjlli commented on a change in pull request #6129: Issue #4854 Framework for adding compatibility tests

jackjlli commented on a change in pull request #6129:
URL: https://github.com/apache/incubator-pinot/pull/6129#discussion_r504300900



##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/compat/SegmentOp.java
##########
@@ -0,0 +1,95 @@
+/**
+ * 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.pinot.tools.compat;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+
+/**
+ * Segment Operations:
+ * UPLOAD:
+ *   Generates a segment for a table from the data in the input file.
+ *   Uploads the segment, and verifies that the segments appear in externalview
+ * DELETE:
+ *   Deletes the segment from the table.
+ *
+ * TODO:
+ *  - Maybe segment names can be auto-generated if the name is "AUTO".
+ *  - We can add segmentGeneration config file as an option also
+ *  - We can consider supporting different readers, starting with csv. Will help in easily scanning the data.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SegmentOp extends BaseOp {
+  public enum Op {
+    UPLOAD,
+    DELETE
+  }
+
+  private Op _op;
+  private String _inputDataFileName;
+  private String _segmentName;
+  private String _tableConfigFileName;
+
+  public SegmentOp() {
+    super(OpType.SEGMENT_OP);
+  }
+
+  public Op getOp() {
+    return _op;
+  }
+
+  public void setOp(Op op) {
+    _op = op;
+  }
+
+  public String getInputDataFileName() {
+    return _inputDataFileName;
+  }
+
+  public void setInputDataFileName(String inputDataFileName) {
+    _inputDataFileName = inputDataFileName;
+  }
+
+  public String getSegmentName() {
+    return _segmentName;
+  }
+
+  public void setSegmentName(String segmentName) {
+    _segmentName = segmentName;
+  }
+
+  public String getTableConfigFileName() {
+    return _tableConfigFileName;
+  }
+
+  public void setTableConfigFileName(String tableConfigFileName) {
+    _tableConfigFileName = tableConfigFileName;
+  }
+
+  @Override
+  boolean runOp() {
+    switch(_op) {
+      case UPLOAD:
+        System.out.println("Generating segment " + _segmentName + " from " + _inputDataFileName + " and uploading to " +

Review comment:
       We may not need to print it out in the console?




----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org