Motr  M0
idx.h File Reference
#include "motr/client.h"
#include "dix/layout.h"
Include dependency graph for idx.h:

Go to the source code of this file.

Data Structures

struct  m0_idx_query_ops
 
struct  m0_idx_service_ops
 
struct  m0_idx_service
 
struct  m0_idx_service_ctx
 
struct  m0_idx_cass_config
 
struct  m0_idx_dix_config
 

Macros

#define __MOTR_IDX_H__
 

Enumerations

enum  m0_idx_service_type { M0_IDX_MOCK, M0_IDX_DIX, M0_IDX_CASS, M0_IDX_MAX_SERVICE_ID }
 
enum  m0_op_idx_flags {
  M0_OIF_OVERWRITE = 1 << 0, M0_OIF_EXCLUDE_START_KEY = 1 << 1, M0_OIF_SYNC_WAIT = 1 << 2, M0_OIF_SKIP_LAYOUT = 1 << 3,
  M0_OIF_CROW = 1 << 4
}
 

Functions

 M0_BOB_DECLARE (M0_INTERNAL, m0_op_idx)
 
M0_INTERNAL bool m0__idx_op_invariant (struct m0_op_idx *oi)
 
M0_INTERNAL void idx_op_ast_complete (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
M0_INTERNAL void idx_op_ast_executed (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
M0_INTERNAL void idx_op_ast_stable (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
M0_INTERNAL void idx_op_ast_fail (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
M0_INTERNAL int m0_idx_op_namei (struct m0_entity *entity, struct m0_op **op, enum m0_entity_opcode opcode)
 
M0_INTERNAL void m0_idx_service_config (struct m0_client *m0c, int svc_id, void *svc_conf)
 
M0_INTERNAL void m0_idx_service_register (int svc_id, struct m0_idx_service_ops *sops, struct m0_idx_query_ops *qops)
 
M0_INTERNAL void m0_idx_services_register (void)
 
M0_INTERNAL void m0_idx_mock_register (void)
 
M0_INTERNAL void m0_idx_dix_register (void)
 

Variables

const struct m0_bob_type oi_bobtype
 

Macro Definition Documentation

◆ __MOTR_IDX_H__

#define __MOTR_IDX_H__

Definition at line 26 of file idx.h.

Enumeration Type Documentation

◆ m0_idx_service_type

Types of index services supported by Client.

Enumerator
M0_IDX_MOCK 

Simple service without persistent storage.

M0_IDX_DIX 

Service based on Motr distributed indexing component. Two types of indices are supported:

  • distributed index, which is distributed over multiple storage devices and network nodes in the cluster for performance, scalability and fault tolerance.
  • non-distributed index, which is stored on a single node. Client user can't choose the node, the first CAS service from Motr configuration is used.
M0_IDX_CASS 

Service using Cassandra database as persistent storage.

M0_IDX_MAX_SERVICE_ID 

Definition at line 57 of file idx.h.

◆ m0_op_idx_flags

Values of index operation flags supported by Client index operation.

Enumerator
M0_OIF_OVERWRITE 

For M0_IC_PUT operation, instructs it to silently overwrite existing record with the same key, if any.

M0_OIF_EXCLUDE_START_KEY 

For M0_IC_NEXT operation, instructs it to skip record with the given start key.

M0_OIF_SYNC_WAIT 

For M0_IC_PUT/M0_IC_DEL operation, instructs it to delay the reply until data is persisted.

M0_OIF_SKIP_LAYOUT 

For M0_EO_CREATE/M0_EO_DELETE operations, instructs to skip update of meta indices during index operations.

M0_OIF_CROW 

For M0_EO_CREATE/M0_EO_DELETE operations, instructs to create btree on write during PUT operation.

Definition at line 77 of file idx.h.

Function Documentation

◆ idx_op_ast_complete()

M0_INTERNAL void idx_op_ast_complete ( struct m0_sm_group grp,
struct m0_sm_ast ast 
)

AST callback to complete a whole index operation.

Parameters
grpgroup the AST is executed in.
astcallback being executed.

Definition at line 311 of file idx.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ idx_op_ast_executed()

M0_INTERNAL void idx_op_ast_executed ( struct m0_sm_group grp,
struct m0_sm_ast ast 
)

Definition at line 299 of file idx.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ idx_op_ast_fail()

M0_INTERNAL void idx_op_ast_fail ( struct m0_sm_group grp,
struct m0_sm_ast ast 
)

AST callback to fail a whole index operation.

Parameters
grpgroup the AST is executed in.
astcallback being executed.

Definition at line 367 of file idx.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ idx_op_ast_stable()

M0_INTERNAL void idx_op_ast_stable ( struct m0_sm_group grp,
struct m0_sm_ast ast 
)

Definition at line 293 of file idx.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0__idx_op_invariant()

M0_INTERNAL bool m0__idx_op_invariant ( struct m0_op_idx oi)

Checks an index operation is not malformed or corrupted.

Parameters
oiindex operation to be checked.
Returns
true if the operation is not malformed or false if some error was detected.

Definition at line 74 of file idx.c.

Here is the caller graph for this function:

◆ M0_BOB_DECLARE()

M0_BOB_DECLARE ( M0_INTERNAL  ,
m0_op_idx   
)

◆ m0_idx_mock_register()

M0_INTERNAL void m0_idx_mock_register ( void  )

Definition at line 768 of file idx_mock.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_idx_op_namei()

M0_INTERNAL int m0_idx_op_namei ( struct m0_entity entity,
struct m0_op **  op,
enum m0_entity_opcode  opcode 
)

Sets an entity operation to create or delete an index.

Parameters
entityentity to be modified.
oppointer to the operation being set.
opcodeM0_EO_CREATE or M0_EO_DELETE.
Returns
0 if the function succeeds or an error code otherwise.

Definition at line 603 of file idx.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_idx_service_config()

M0_INTERNAL void m0_idx_service_config ( struct m0_client m0c,
int  svc_id,
void *  svc_conf 
)

Definition at line 654 of file idx.c.

Here is the caller graph for this function:

◆ m0_idx_service_register()

M0_INTERNAL void m0_idx_service_register ( int  svc_id,
struct m0_idx_service_ops sops,
struct m0_idx_query_ops qops 
)

Definition at line 670 of file idx.c.

Here is the caller graph for this function:

◆ m0_idx_services_register()

M0_INTERNAL void m0_idx_services_register ( void  )

Definition at line 683 of file idx.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ oi_bobtype

const struct m0_bob_type oi_bobtype

Definition at line 44 of file idx.c.