jina.enums¶
Miscellaneous enums used in jina
To use these enums in YAML config, following the example below:
!Flow
with:
logserver_config: yaml/test-server-config.yml
optimize_level: !FlowOptimizeLevel IGNORE_GATEWAY
# or
optimize_level: IGNORE_GATEWAY
#or
optimize_level: ignore_gateway
no_gateway: true
chunk_idx:
uses: index/chunk.yml
parallel: ${{PARALLEL}}
separated_workspace: true
parallel_type: !PollingType ANY
# or
parallel_type: ANY
# or
parallel_type: any
-
class
jina.enums.
SchedulerType
[source]¶ Bases:
jina.enums.BetterEnum
An enumeration.
-
LOAD_BALANCE
= 0¶ balance the workload between Peas, faster peas get more work
-
ROUND_ROBIN
= 1¶ workload are scheduled round-robin manner to the peas, assuming all peas have uniform processing speed.
-
-
class
jina.enums.
PollingType
[source]¶ Bases:
jina.enums.BetterEnum
The enum for representing the parallel type of peas in a pod
-
ANY
= 1¶ one of the replica will receive the message
-
ALL
= 2¶ all replica will receive the message, blocked until all done with the message
-
ALL_ASYNC
= 3¶ (reserved) all replica will receive the message, but any one of them can return, useful in backup
-
property
is_push
¶ - Return type
bool
- Returns
if this
PollingType
is using push protocol
-
property
is_block
¶ - Return type
bool
- Returns
if this
PollingType
is requiring block protocol
-
-
class
jina.enums.
FlowOptimizeLevel
[source]¶ Bases:
jina.enums.BetterEnum
The level of flow optimization
-
NONE
= 0¶
-
IGNORE_GATEWAY
= 1¶
-
FULL
= 2¶
-
-
class
jina.enums.
LogVerbosity
[source]¶ Bases:
jina.enums.BetterEnum
Verbosity level of the logger
-
DEBUG
= 10¶
-
INFO
= 20¶
-
SUCCESS
= 25¶
-
WARNING
= 30¶
-
ERROR
= 40¶
-
CRITICAL
= 50¶
-
-
class
jina.enums.
SocketType
[source]¶ Bases:
jina.enums.BetterEnum
Enums for representing the socket type in a pod
-
PULL_BIND
= 0¶
-
PULL_CONNECT
= 1¶
-
PUSH_BIND
= 2¶
-
PUSH_CONNECT
= 3¶
-
SUB_BIND
= 4¶
-
SUB_CONNECT
= 5¶
-
PUB_BIND
= 6¶
-
PUB_CONNECT
= 7¶
-
PAIR_BIND
= 8¶
-
PAIR_CONNECT
= 9¶
-
ROUTER_BIND
= 10¶
-
DEALER_CONNECT
= 11¶
-
property
is_bind
¶ - Return type
bool
- Returns
if this socket is using bind protocol
-
property
is_receive
¶ - Return type
bool
- Returns
if this socket is used for receiving data
-
property
is_pubsub
¶ - Returns
if this socket is used for publish or subscribe data
-
property
paired
¶ - Return type
- Returns
a paired
-
-
class
jina.enums.
FlowOutputType
[source]¶ Bases:
jina.enums.BetterEnum
The enum for representing flow output config
-
SHELL_PROC
= 0¶ a shell-script, run each microservice as a process
-
SHELL_DOCKER
= 1¶ a shell-script, run each microservice as a container
-
DOCKER_SWARM
= 2¶ a docker-swarm YAML config
-
K8S
= 3¶ a Kubernetes YAML config
-
-
class
jina.enums.
FlowBuildLevel
[source]¶ Bases:
jina.enums.BetterEnum
The enum for representing a flow’s build level
Some
jina.flow.Flow
class functions require certain build level to run.-
EMPTY
= 0¶ Nothing is built
-
GRAPH
= 1¶ The underlying graph is built, you may visualize the flow
-
-
class
jina.enums.
PeaRoleType
[source]¶ Bases:
jina.enums.BetterEnum
The enum of a Pea role
-
SINGLETON
= 0¶
-
HEAD
= 1¶
-
TAIL
= 2¶
-
PARALLEL
= 3¶
-
-
class
jina.enums.
PodRoleType
[source]¶ Bases:
jina.enums.BetterEnum
The enum of a Pod role for visualization
-
POD
= 0¶
-
JOIN
= 1¶
-
INSPECT
= 2¶
-
GATEWAY
= 3¶
-
INSPECT_AUX_PASS
= 4¶
-
JOIN_INSPECT
= 5¶
-
property
is_inspect
¶ if the role is inspect pod related
- Return type
bool
- Returns
-
-
class
jina.enums.
RequestType
[source]¶ Bases:
jina.enums.BetterEnum
The enum of Client mode
-
INDEX
= 0¶
-
SEARCH
= 1¶
-
DELETE
= 2¶
-
UPDATE
= 3¶
-
CONTROL
= 4¶
-
TRAIN
= 5¶
-
-
class
jina.enums.
CompressAlgo
[source]¶ Bases:
jina.enums.BetterEnum
The enum of Compress algorithms
Note
LZ4 requires additional package, to install it use pip install “jina[lz4]”
-
NONE
= 0¶
-
LZ4
= 1¶
-
ZLIB
= 2¶
-
GZIP
= 3¶
-
BZ2
= 4¶
-
LZMA
= 5¶
-
-
class
jina.enums.
SkipOnErrorType
[source]¶ Bases:
jina.enums.BetterEnum
The level of error handling
Warning
In theory, all methods below do not 100% guarantee the success execution on the sequel flow. If something is wrong in the upstream, it is hard to CARRY this exception and moving forward without ANY side-effect.
-
NONE
= 0¶
-
EXECUTOR
= 1¶
-
HANDLE
= 2¶
-
-
class
jina.enums.
FlowInspectType
[source]¶ Bases:
jina.enums.BetterEnum
Inspect strategy in the flow
-
HANG
= 0¶
-
REMOVE
= 1¶
-
COLLECT
= 2¶
-
property
is_keep
¶ - Return type
bool
- Returns
if this socket is using bind protocol
-
-
class
jina.enums.
RemoteAccessType
[source]¶ Bases:
jina.enums.BetterEnum
Remote access type when connect to the host
-
SSH
= 0¶
-
JINAD
= 1¶
-
-
class
jina.enums.
RemotePeapodType
[source]¶ Bases:
jina.enums.BetterEnum
Remote access type when connect to the host
-
PEA
= 0¶
-
POD
= 1¶
-
-
class
jina.enums.
BuildTestLevel
[source]¶ Bases:
jina.enums.BetterEnum
Test level in jina hub build, higher level includes lower levels
-
NONE
= 0¶
-
EXECUTOR
= 1¶
-
POD_NONDOCKER
= 2¶
-
POD_DOCKER
= 3¶
-
FLOW
= 4¶
-
-
class
jina.enums.
DataInputType
[source]¶ Bases:
jina.enums.BetterEnum
Data input type in the request generator
-
AUTO
= 0¶
-
DOCUMENT
= 1¶
-
CONTENT
= 2¶
-
-
class
jina.enums.
RuntimeBackendType
[source]¶ Bases:
jina.enums.BetterEnum
An enumeration.
-
THREAD
= 0¶
-
PROCESS
= 1¶
-