[VOL-4291] Rw-core updates for gRPC migration

Change-Id: I8d5a554409115b29318089671ca4e1ab3fa98810
diff --git a/rw_core/config/config.go b/rw_core/config/config.go
index 327302f..ad885c2 100644
--- a/rw_core/config/config.go
+++ b/rw_core/config/config.go
@@ -30,15 +30,12 @@
 // RWCoreFlags represents the set of configurations used by the read-write core service
 type RWCoreFlags struct {
 	// Command line parameters
-	RWCoreEndpoint              string
-	GrpcAddress                 string
-	KafkaAdapterAddress         string
+	GrpcNBIAddress              string
+	GrpcSBIAddress              string
 	KafkaClusterAddress         string
 	KVStoreType                 string
 	KVStoreTimeout              time.Duration
 	KVStoreAddress              string
-	KVTxnKeyDelTime             int
-	CoreTopic                   string
 	EventTopic                  string
 	LogLevel                    string
 	Banner                      bool
@@ -46,10 +43,8 @@
 	RWCoreKey                   string
 	RWCoreCert                  string
 	RWCoreCA                    string
-	LongRunningRequestTimeout   time.Duration
-	DefaultRequestTimeout       time.Duration
-	DefaultCoreTimeout          time.Duration
-	CoreBindingKey              string
+	InternalTimeout             time.Duration
+	RPCTimeout                  time.Duration
 	MaxConnectionRetries        int
 	ConnectionRetryInterval     time.Duration
 	LiveProbeInterval           time.Duration
@@ -69,94 +64,125 @@
 
 	fs := flag.NewFlagSet(os.Args[0], flag.ExitOnError)
 
-	fs.StringVar(&cf.RWCoreEndpoint, "vcore-endpoint",
-		"rwcore", "RW core endpoint address")
+	fs.StringVar(&cf.GrpcNBIAddress,
+		"grpc_nbi_address",
+		":50057",
+		"GRPC NBI server - address")
 
-	fs.StringVar(&cf.GrpcAddress, "grpc_address",
-		":50057", "GRPC server - address")
+	fs.StringVar(&cf.GrpcSBIAddress,
+		"grpc_sbi_address",
+		":50058",
+		"GRPC SBI server - address")
 
-	fs.StringVar(&cf.KafkaAdapterAddress, "kafka_adapter_address",
-		"127.0.0.1:9092", "Kafka - Adapter messaging address")
+	fs.StringVar(&cf.KafkaClusterAddress,
+		"kafka_cluster_address",
+		"127.0.0.1:9092",
+		"Kafka - Cluster messaging address")
 
-	fs.StringVar(&cf.KafkaClusterAddress, "kafka_cluster_address",
-		"127.0.0.1:9094", "Kafka - Cluster messaging address")
+	fs.StringVar(&cf.EventTopic,
+		"event_topic",
+		"voltha.events",
+		"RW Core Event topic")
 
-	fs.StringVar(&cf.CoreTopic, "rw_core_topic",
-		"rwcore", "RW Core topic")
+	fs.StringVar(&cf.KVStoreType,
+		"kv_store_type",
+		EtcdStoreName,
+		"KV store type")
 
-	fs.StringVar(&cf.EventTopic, "event_topic",
-		"voltha.events", "RW Core Event topic")
+	fs.DurationVar(&cf.KVStoreTimeout,
+		"kv_store_request_timeout",
+		5*time.Second,
+		"The default timeout when making a kv store request")
 
-	fs.StringVar(&cf.KVStoreType, "kv_store_type",
-		EtcdStoreName, "KV store type")
+	fs.StringVar(&cf.KVStoreAddress,
+		"kv_store_address",
+		"127.0.0.1:2379",
+		"KV store address")
 
-	fs.DurationVar(&cf.KVStoreTimeout, "kv_store_request_timeout",
-		5*time.Second, "The default timeout when making a kv store request")
+	fs.StringVar(&cf.LogLevel,
+		"log_level",
+		"warn",
+		"Log level")
 
-	fs.StringVar(&cf.KVStoreAddress, "kv_store_address",
-		"127.0.0.1:2379", "KV store address")
+	fs.DurationVar(&(cf.InternalTimeout),
+		"internal_timeout",
+		5*time.Second,
+		"Core internal timeout")
 
-	fs.IntVar(&cf.KVTxnKeyDelTime, "kv_txn_delete_time",
-		60, "The time to wait before deleting a completed transaction key")
+	fs.DurationVar(&(cf.RPCTimeout),
+		"rpc_timeout",
+		5*time.Second,
+		"RPC timeout")
 
-	fs.StringVar(&cf.LogLevel, "log_level",
-		"warn", "Log level")
+	fs.BoolVar(&cf.Banner,
+		"banner",
+		false,
+		"Show startup banner log lines")
 
-	fs.DurationVar(&cf.LongRunningRequestTimeout, "timeout_long_request",
-		2000*time.Millisecond, "Timeout for long running request")
+	fs.BoolVar(&cf.DisplayVersionOnly,
+		"version",
+		false,
+		"Show version information and exit")
 
-	fs.DurationVar(&cf.DefaultRequestTimeout, "timeout_request",
-		1000*time.Millisecond, "Default timeout for regular request")
+	fs.IntVar(&cf.MaxConnectionRetries,
+		"max_connection_retries",
+		-1,
+		"The number of retries to connect to a dependent component")
 
-	fs.DurationVar(&cf.DefaultCoreTimeout, "core_timeout",
-		1000*time.Millisecond, "Default Core timeout")
+	fs.DurationVar(&cf.ConnectionRetryInterval,
+		"connection_retry_interval",
+		2*time.Second,
+		"The number of seconds between each connection retry attempt")
 
-	fs.BoolVar(&cf.Banner, "banner",
-		false, "Show startup banner log lines")
+	fs.DurationVar(&cf.LiveProbeInterval,
+		"live_probe_interval",
+		60*time.Second,
+		"The number of seconds between liveness probes while in a live state")
 
-	fs.BoolVar(&cf.DisplayVersionOnly, "version",
-		false, "Show version information and exit")
+	fs.DurationVar(&cf.NotLiveProbeInterval,
+		"not_live_probe_interval",
+		5*time.Second,
+		"The number of seconds between liveness probes while in a not live state")
 
-	fs.StringVar(&cf.CoreBindingKey, "core_binding_key",
-		"voltha_backend_name", "The name of the meta-key whose value is the rw-core group to which the ofagent is bound")
+	fs.StringVar(&cf.ProbeAddress,
+		"probe_address",
+		":8080",
+		"The address on which to listen to answer liveness and readiness probe queries over HTTP")
 
-	fs.IntVar(&cf.MaxConnectionRetries, "max_connection_retries",
-		-1, "The number of retries to connect to a dependent component")
+	fs.BoolVar(&(cf.TraceEnabled),
+		"trace_enabled",
+		false,
+		"Whether to send logs to tracing agent?")
 
-	fs.DurationVar(&cf.ConnectionRetryInterval, "connection_retry_interval",
-		2*time.Second, "The number of seconds between each connection retry attempt")
+	fs.StringVar(&cf.TraceAgentAddress,
+		"trace_agent_address",
+		"127.0.0.1:6831",
+		"The address of tracing agent to which span info should be sent")
 
-	fs.DurationVar(&cf.LiveProbeInterval, "live_probe_interval",
-		60*time.Second, "The number of seconds between liveness probes while in a live state")
+	fs.BoolVar(&cf.LogCorrelationEnabled,
+		"log_correlation_enabled",
+		true,
+		"Whether to enrich log statements with fields denoting operation being executed for achieving correlation?")
 
-	fs.DurationVar(&cf.NotLiveProbeInterval, "not_live_probe_interval",
-		5*time.Second, "The number of seconds between liveness probes while in a not live state")
-
-	fs.StringVar(&cf.ProbeAddress, "probe_address",
-		":8080", "The address on which to listen to answer liveness and readiness probe queries over HTTP")
-
-	fs.BoolVar(&(cf.TraceEnabled), "trace_enabled",
-		false, "Whether to send logs to tracing agent?")
-
-	fs.StringVar(&cf.TraceAgentAddress, "trace_agent_address",
-		"127.0.0.1:6831", "The address of tracing agent to which span info should be sent")
-
-	fs.BoolVar(&cf.LogCorrelationEnabled, "log_correlation_enabled",
-		true, "Whether to enrich log statements with fields denoting operation being executed for achieving correlation?")
-
-	fs.StringVar(&cf.VolthaStackID, "stack_id",
-		"voltha", "ID for the current voltha stack")
+	fs.StringVar(&cf.VolthaStackID,
+		"stack_id",
+		"voltha",
+		"ID for the current voltha stack")
 
 	fs.DurationVar(&cf.BackoffRetryInitialInterval,
-		"backoff_retry_initial_interval", 500*time.Millisecond,
+		"backoff_retry_initial_interval",
+		500*time.Millisecond,
 		"The initial number of milliseconds an exponential backoff will wait before a retry")
 
 	fs.DurationVar(&cf.BackoffRetryMaxElapsedTime,
-		"backoff_retry_max_elapsed_time", 0*time.Second,
+		"backoff_retry_max_elapsed_time",
+		0*time.Second,
 		"The maximum number of milliseconds an exponential backoff can elasped")
 
-	fs.DurationVar(&cf.BackoffRetryMaxInterval, "backoff_retry_max_interval",
-		1*time.Minute, "The maximum number of milliseconds of an exponential backoff interval")
+	fs.DurationVar(&cf.BackoffRetryMaxInterval,
+		"backoff_retry_max_interval",
+		1*time.Minute,
+		"The maximum number of milliseconds of an exponential backoff interval")
 
 	_ = fs.Parse(args)
 }