// Copyright 2016-2020 Google LLC. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// reference: https://github.com/GoogleCloudPlatform/processing-logs-using-dataflow

package com.google.cloud.solutions;

import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.StreamingOptions;
import org.apache.beam.sdk.options.Default;
import org.apache.beam.sdk.options.Description;

@SuppressWarnings("unused")
public interface LogAnalyticsPipelineOptions extends PipelineOptions {
    @Description("Location of logs, Cloud Storage path or Cloud Pub/Sub subscription")
    @Default.String("gs://alchemy-logdata/input/Sample_log_*") //"input/Sample_log_*.csv"
    String getLogSource();
    void setLogSource(String logSource);

    @Description("BigQueryIO.Write needs a GCS temp location to store temp files")
    @Default.String("gs://alchemy-logdata/temp")
    String getBQTempLocation();
    void setBQTempLocation(String tempLocation);

    @Description("Time interval as \"windowing\"")
    @Default.Long(2) // in second
    long getTimeInterval();
    void setTimeInterval(long TimeInterval);

    @Description("Counts of time intervals")
    @Default.Long(5) // in second
    long getTimeIntervalCount();
    void setTimeIntervalCount(long TimeIntervalCount);

    @Description("Entity type")
    @Default.String("service") // "consumer"
    String getEntityType();
    void setEntityType(String entityType);

    @Description("field name")
    @Default.String("query") // "status", "check", "quota"
    String getFieldName();
    void setFieldName(String fieldName);

    @Description("BigQuery table name for timestamp_entity_field table")
    @Default.String("dataflow_log_analytics.timestamp_entity_field_table")
    String getTimestampEntityFieldTableName();
    void setTimestampEntityFieldTableName(String timestampEntityFieldTableName);

    @Description("BigQuery table schema for timestamp_entity_field table, comma-separated values of [field-name]:[TYPE]")
    @Default.String("seconds:STRING,entityType:STRING,entityName:STRING,fieldName:String,fieldValue:STRING")
    String getTimestampEntityFieldTableSchema();
    void setTimestampEntityFieldTableSchema(String timestampEntityFieldTableSchema);

    @Description("BigQuery table name for service_field_stats table")
    @Default.String("dataflow_log_analytics.service_field_stats_table")
    String getServiceFieldStatsTableName();
    void setServiceFieldStatsTableName(String serviceFieldStatsTableName);

    @Description("BigQuery table schema for service_field_stats table, comma-separated values of [field-name]:[TYPE]")
    @Default.String("service:STRING,querySum:STRING,checkSum:STRING,quotaSum:STRING,statusSum:STRING,queryPerInterval:STRING,queryDev:STRING,checkRatio:STRING,quotaRatio:STRING,statusRatio:STRING")
    String getServiceFieldStatsTableSchema();
    void setServiceFieldStatsTableSchema(String serviceFieldStatsTableSchema);

    @Description("BigQuery table name for consumer_field_stats table")
    @Default.String("dataflow_log_analytics.consumer_field_stats_table")
    String getConsumerFieldStatsTableName();
    void setConsumerFieldStatsTableName(String consumerFieldStatsTableName);

    @Description("BigQuery table schema for consumer_field_stats table, comma-separated values of [field-name]:[TYPE]")
    @Default.String("consumer:STRING,querySum:STRING,queryPerInterval:STRING,queryDev:STRING")
    String getConsumerFieldStatsTableSchema();
    void setConsumerFieldStatsTableSchema(String consumerFieldStatsTableSchema);
}

@@ -2756,32 +2756,739 @@
 eldTableSchema);
+%0A    %0A    @Description(%22BigQuery table name for timestamp_service_field_list table%22)%0A    @Default.String(%22dataflow_log_analytics.timestamp_service_field_list_table%22)%0A    String getTimestampServiceFieldListTableName();%0A    void setTimestampServiceFieldListTableName(String timestampServiceFieldListTableName);%0A%0A    @Description(%22BigQuery table schema for timestamp_service_field_list table, comma-separated values of %5Bfield-name%5D:%5BTYPE%5D%22)%0A    @Default.String(%22seconds:STRING,service:STRING,query:String,checkError:STRING,quotaError:String,statusError:STRING%22)%0A    String getTimestampServiceFieldListTableSchema();%0A    void setTimestampServiceFieldListTableSchema(String timestampServiceFieldListTableSchema);
 %0A%0A    @Descripti
@@ -3911,16 +3911,21 @@
 NG,check
+Error
 Sum:STRI
@@ -3932,16 +3932,21 @@
 NG,quota
+Error
 Sum:STRI
@@ -3954,16 +3954,21 @@
 G,status
+Error
 Sum:STRI
@@ -4015,16 +4015,21 @@
 NG,check
+Error
 Ratio:ST
@@ -4038,16 +4038,21 @@
 NG,quota
+Error
 Ratio:ST
@@ -4062,16 +4062,21 @@
 G,status
+Error
 Ratio:ST

Update LogAnalyticsPipelineOptions.java