Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ResolverInstance = &Resolver{}
ResolverInstance is the singleton instance of a DB name resolver
Functions ¶
This section is empty.
Types ¶
type PartitionType ¶
type PartitionType string
PartitionType defines the type of DB partition
const ( // PartitionNone indicates that the DB shouldn't be partitioned PartitionNone PartitionType = "" // PartitionPeer indicates that the DB should be partitioned by peer ID PartitionPeer PartitionType = "PEER" // PartitionMSP indicates that the DB should be partitioned by MSP ID PartitionMSP PartitionType = "MSP" )
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves database names according to the configured partition type.
func (*Resolver) Initialize ¶
Initialize is called on peer startup to initialize the Resolver
func (*Resolver) IsRelevant ¶
IsRelevant returns true if the given database name is one of the local peer's databases. Otherwise, false if the database is not relevant to the peer (i.e. it may be a database belonging to another peer/cluster).
func (*Resolver) Resolve ¶
Resolve resolves the database name according to partition type. If partition type is not specified then the database name should not be changed. If partition type is PER_PEER then the peer ID is used as a prefix to the DB name. If partition type is PER_MSP then the MSP ID is used as a prefix to the DB name.