Package com.linkedin.venice.router.api
Class VenicePathParser<HTTP_REQUEST extends BasicHttpRequest>
- java.lang.Object
-
- com.linkedin.venice.router.api.VenicePathParser<HTTP_REQUEST>
-
- All Implemented Interfaces:
ExtendedResourcePathParser<VenicePath,RouterKey,HTTP_REQUEST>
,ResourcePathParser<VenicePath,RouterKey>
public class VenicePathParser<HTTP_REQUEST extends BasicHttpRequest> extends java.lang.Object implements ExtendedResourcePathParser<VenicePath,RouterKey,HTTP_REQUEST>
Inbound single get request to the router will look like: GET /storage/storeName/key?f=fmt 'storage' is a literal, meaning we will request the value for a single key storeName will be the name of the requested store key is the key being looked up fmt is an optional format parameter, one of 'string' or 'b64'. If omitted, assumed to be 'string' Batch get requests look like: POST /storage/storeName And the keys are concatenated in the POST body. The VenicePathParser is responsible for looking up the active version of the store, and constructing the store-version
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACTION_DISABLE
static java.lang.String
ACTION_ENABLE
static java.lang.String
SEP
static int
STORE_MAX_LENGTH
static java.util.regex.Pattern
STORE_PATTERN
static java.lang.String
TASK_READ_QUOTA_THROTTLE
static java.lang.String
TYPE_ADMIN
static java.lang.String
TYPE_BLOB_DISCOVERY
static java.lang.String
TYPE_CLUSTER_DISCOVERY
static java.lang.String
TYPE_COMPUTE
static java.lang.String
TYPE_CURRENT_VERSION
static java.lang.String
TYPE_GET_UPDATE_SCHEMA
static java.lang.String
TYPE_HEALTH_CHECK
static java.lang.String
TYPE_KEY_SCHEMA
static java.lang.String
TYPE_LEADER_CONTROLLER
static java.lang.String
TYPE_LEADER_CONTROLLER_LEGACY
Deprecated.static java.lang.String
TYPE_REQUEST_TOPIC
static java.lang.String
TYPE_RESOURCE_STATE
static java.lang.String
TYPE_STORAGE
static java.lang.String
TYPE_VALUE_SCHEMA
-
Constructor Summary
Constructors Constructor Description VenicePathParser(VeniceVersionFinder versionFinder, VenicePartitionFinder partitionFinder, RouterStats<AggRouterHttpRequestStats> routerStats, ReadOnlyStoreRepository storeRepository, VeniceRouterConfig routerConfig, CompressorFactory compressorFactory, io.tehuti.metrics.MetricsRepository metricsRepository, java.util.concurrent.ScheduledExecutorService retryManagerScheduler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isStoreNameValid(java.lang.String storeName)
VenicePath
parseResourceUri(java.lang.String uri)
VenicePath
parseResourceUri(java.lang.String uri, HTTP_REQUEST request)
VenicePath
substitutePartitionKey(VenicePath path, RouterKey s)
VenicePath
substitutePartitionKey(VenicePath path, java.util.Collection<RouterKey> s)
-
-
-
Field Detail
-
STORE_PATTERN
public static final java.util.regex.Pattern STORE_PATTERN
-
STORE_MAX_LENGTH
public static final int STORE_MAX_LENGTH
- See Also:
- Constant Field Values
-
SEP
public static final java.lang.String SEP
- See Also:
- Constant Field Values
-
TYPE_STORAGE
public static final java.lang.String TYPE_STORAGE
- See Also:
- Constant Field Values
-
TYPE_COMPUTE
public static final java.lang.String TYPE_COMPUTE
- See Also:
- Constant Field Values
-
TASK_READ_QUOTA_THROTTLE
public static final java.lang.String TASK_READ_QUOTA_THROTTLE
- See Also:
- Constant Field Values
-
ACTION_ENABLE
public static final java.lang.String ACTION_ENABLE
- See Also:
- Constant Field Values
-
ACTION_DISABLE
public static final java.lang.String ACTION_DISABLE
- See Also:
- Constant Field Values
-
TYPE_LEADER_CONTROLLER
public static final java.lang.String TYPE_LEADER_CONTROLLER
-
TYPE_LEADER_CONTROLLER_LEGACY
@Deprecated public static final java.lang.String TYPE_LEADER_CONTROLLER_LEGACY
Deprecated.
-
TYPE_KEY_SCHEMA
public static final java.lang.String TYPE_KEY_SCHEMA
-
TYPE_VALUE_SCHEMA
public static final java.lang.String TYPE_VALUE_SCHEMA
-
TYPE_GET_UPDATE_SCHEMA
public static final java.lang.String TYPE_GET_UPDATE_SCHEMA
-
TYPE_CLUSTER_DISCOVERY
public static final java.lang.String TYPE_CLUSTER_DISCOVERY
-
TYPE_REQUEST_TOPIC
public static final java.lang.String TYPE_REQUEST_TOPIC
-
TYPE_HEALTH_CHECK
public static final java.lang.String TYPE_HEALTH_CHECK
-
TYPE_ADMIN
public static final java.lang.String TYPE_ADMIN
-
TYPE_RESOURCE_STATE
public static final java.lang.String TYPE_RESOURCE_STATE
-
TYPE_CURRENT_VERSION
public static final java.lang.String TYPE_CURRENT_VERSION
-
TYPE_BLOB_DISCOVERY
public static final java.lang.String TYPE_BLOB_DISCOVERY
-
-
Constructor Detail
-
VenicePathParser
public VenicePathParser(VeniceVersionFinder versionFinder, VenicePartitionFinder partitionFinder, RouterStats<AggRouterHttpRequestStats> routerStats, ReadOnlyStoreRepository storeRepository, VeniceRouterConfig routerConfig, CompressorFactory compressorFactory, io.tehuti.metrics.MetricsRepository metricsRepository, java.util.concurrent.ScheduledExecutorService retryManagerScheduler)
-
-
Method Detail
-
parseResourceUri
public VenicePath parseResourceUri(java.lang.String uri, HTTP_REQUEST request) throws RouterException
- Specified by:
parseResourceUri
in interfaceExtendedResourcePathParser<VenicePath,RouterKey,HTTP_REQUEST extends BasicHttpRequest>
- Throws:
RouterException
-
parseResourceUri
public VenicePath parseResourceUri(java.lang.String uri) throws RouterException
- Specified by:
parseResourceUri
in interfaceResourcePathParser<VenicePath,RouterKey>
- Throws:
RouterException
-
substitutePartitionKey
public VenicePath substitutePartitionKey(VenicePath path, RouterKey s)
- Specified by:
substitutePartitionKey
in interfaceResourcePathParser<VenicePath,RouterKey>
-
substitutePartitionKey
public VenicePath substitutePartitionKey(VenicePath path, java.util.Collection<RouterKey> s)
- Specified by:
substitutePartitionKey
in interfaceResourcePathParser<VenicePath,RouterKey>
-
isStoreNameValid
public static boolean isStoreNameValid(java.lang.String storeName)
-
-