Documentation ¶
Index ¶
- Constants
- func SendCommandToServer(url string, command raft.Command) (interface{}, error)
- type ChangeDbUserPassword
- type ChangeDbUserPermissions
- type ContinuousQueryWriter
- type Coordinator
- func (self *Coordinator) AuthenticateClusterAdmin(username, password string) (common.User, error)
- func (self *Coordinator) AuthenticateDbUser(db, username, password string) (common.User, error)
- func (self *Coordinator) ChangeClusterAdminPassword(requester common.User, username, password string) error
- func (self *Coordinator) ChangeDbUserPassword(requester common.User, db, username, password string) error
- func (self *Coordinator) ChangeDbUserPermissions(requester common.User, db, username, readPermissions, writePermissions string) error
- func (self *Coordinator) CommitSeriesData(db string, serieses []*protocol.Series, sync bool) error
- func (self *Coordinator) ConnectToProtobufServers(localRaftName string) error
- func (self *Coordinator) CreateClusterAdminUser(requester common.User, username, password string) error
- func (self *Coordinator) CreateDatabase(user common.User, db string) error
- func (self *Coordinator) CreateDbUser(requester common.User, db, username, password string, permissions ...string) error
- func (self *Coordinator) DeleteClusterAdminUser(requester common.User, username string) error
- func (self *Coordinator) DeleteDbUser(requester common.User, db, username string) error
- func (self *Coordinator) DropDatabase(user common.User, db string) error
- func (self *Coordinator) ForceCompaction(user common.User) error
- func (self *Coordinator) GetDbUser(requester common.User, db string, username string) (common.User, error)
- func (self *Coordinator) InterpolateValuesAndCommit(query string, db string, series *protocol.Series, targetName string, ...) error
- func (self *Coordinator) ListClusterAdmins(requester common.User) ([]string, error)
- func (self *Coordinator) ListContinuousQueries(user common.User, db string) ([]*protocol.Series, error)
- func (self *Coordinator) ListDatabases(user common.User) ([]*cluster.Database, error)
- func (self *Coordinator) ListDbUsers(requester common.User, db string) ([]common.User, error)
- func (self *Coordinator) ProcessContinuousQueries(db string, series *protocol.Series)
- func (self *Coordinator) RunQuery(user common.User, database string, queryString string, p engine.Processor) (err error)
- func (self *Coordinator) SetDbAdmin(requester common.User, db, username string, isAdmin bool) error
- func (self *Coordinator) WriteSeriesData(user common.User, db string, series []*protocol.Series) error
- type CreateContinuousQueryCommand
- type CreateDatabaseCommand
- type CreateSeriesFieldIdsCommand
- type CreateShardSpaceCommand
- type CreateShardsCommand
- type DeleteContinuousQueryCommand
- type DropDatabaseCommand
- type DropSeriesCommand
- type DropShardCommand
- type DropShardSpaceCommand
- type Handler
- type InfluxChangeConnectionStringCommand
- type InfluxForceLeaveCommand
- type InfluxJoinCommand
- type MergeChannelProcessor
- type Permissions
- func (self *Permissions) AuthorizeChangeClusterAdminPassword(user common.User) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeChangeDbUserPassword(user common.User, db string, targetUsername string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeChangeDbUserPermissions(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeCreateClusterAdmin(user common.User) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeCreateContinuousQuery(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeCreateDatabase(user common.User) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeCreateDbUser(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeDeleteClusterAdmin(user common.User) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeDeleteContinuousQuery(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeDeleteDbUser(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeDeleteQuery(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeDropDatabase(user common.User) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeDropSeries(user common.User, db string, seriesName string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeGetDbUser(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeGrantDbUserAdmin(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeListClusterAdmins(user common.User) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeListContinuousQueries(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeListDatabases(user common.User) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeListDbUsers(user common.User, db string) (ok bool, err common.AuthorizationError)
- func (self *Permissions) AuthorizeSelectQuery(user common.User, db string, querySpec *parser.QuerySpec) (ok bool, err common.AuthorizationError)
- func (self *Permissions) CheckQueryPermissions(user common.User, db string, querySpec *parser.QuerySpec) (ok bool, err common.AuthorizationError)
- type ProtobufClient
- type ProtobufRequestHandler
- type ProtobufServer
- type RaftServer
- func (s *RaftServer) AssignCoordinator(coordinator *Coordinator) error
- func (s *RaftServer) ChangeConnectionString(raftName, protobufConnectionString, raftConnectionString string, forced bool) error
- func (s *RaftServer) ChangeDbUserPassword(db, username string, hash []byte) error
- func (s *RaftServer) ChangeDbUserPermissions(db, username, readPermissions, writePermissions string) error
- func (self *RaftServer) Close()
- func (s *RaftServer) CommittedAllChanges() bool
- func (s *RaftServer) CompactLog()
- func (s *RaftServer) CreateContinuousQuery(db string, query string) error
- func (s *RaftServer) CreateDatabase(name string) error
- func (s *RaftServer) CreateRootUser() error
- func (self *RaftServer) CreateShardSpace(shardSpace *cluster.ShardSpace) error
- func (self *RaftServer) CreateShards(shards []*cluster.NewShardData) ([]*cluster.ShardData, error)
- func (s *RaftServer) DeleteContinuousQuery(db string, id uint32) error
- func (s *RaftServer) DropDatabase(name string) error
- func (self *RaftServer) DropSeries(database, series string) error
- func (self *RaftServer) DropShard(id uint32, serverIds []uint32) error
- func (self *RaftServer) DropShardSpace(database, name string) error
- func (s *RaftServer) ForceLogCompaction() error
- func (s *RaftServer) GetLeaderRaftConnectString() (string, bool)
- func (s *RaftServer) GetLeaderRaftName() string
- func (self *RaftServer) GetOrSetFieldIdsForSeries(database string, series []*protocol.Series) ([]*protocol.Series, error)
- func (s *RaftServer) GetRaftName() string
- func (s *RaftServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (s *RaftServer) IsLeaderByRaftName(name string) bool
- func (s *RaftServer) Join(leader string) error
- func (s *RaftServer) ListenAndServe() error
- func (s *RaftServer) RemoveServer(id uint32) error
- func (s *RaftServer) SaveClusterAdminUser(u *cluster.ClusterAdmin) error
- func (s *RaftServer) SaveDbUser(u *cluster.DbUser) error
- func (s *RaftServer) Serve(l net.Listener) error
- func (s *RaftServer) SetContinuousQueryTimestamp(timestamp time.Time) error
- func (s *RaftServer) StartProcessingContinuousQueries()
- func (self *RaftServer) UpdateShardSpace(shardSpace *cluster.ShardSpace) error
- type SaveClusterAdminCommand
- type SaveDbUserCommand
- type SetContinuousQueryTimestampCommand
- type ShardAwareObject
- type UpdateShardSpaceCommand
Constants ¶
const ( REQUEST_RETRY_ATTEMPTS = 2 MAX_RESPONSE_SIZE = MAX_REQUEST_SIZE MAX_REQUEST_TIME = time.Second * 1200 RECONNECT_RETRY_WAIT = time.Millisecond * 100 )
const ( DEFAULT_ROOT_PWD = "root" DEFAULT_ROOT_PWD_ENVKEY = "INFLUXDB_INIT_PWD" RAFT_NAME_SIZE = 8 )
const KILOBYTE = 1024
const MAX_REQUEST_SIZE = MEGABYTE * 2
const (
MAX_SIZE = 10 * MEGABYTE
)
const MEGABYTE = 1024 * KILOBYTE
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeDbUserPassword ¶
func NewChangeDbUserPasswordCommand ¶
func NewChangeDbUserPasswordCommand(db, username, hash string) *ChangeDbUserPassword
func (*ChangeDbUserPassword) Apply ¶
func (c *ChangeDbUserPassword) Apply(server raft.Server) (interface{}, error)
func (*ChangeDbUserPassword) CommandName ¶
func (c *ChangeDbUserPassword) CommandName() string
type ChangeDbUserPermissions ¶
type ChangeDbUserPermissions struct { Database string Username string ReadPermissions string WritePermissions string }
func NewChangeDbUserPermissionsCommand ¶
func NewChangeDbUserPermissionsCommand(db, username, readPermissions, writePermissions string) *ChangeDbUserPermissions
func (*ChangeDbUserPermissions) Apply ¶
func (c *ChangeDbUserPermissions) Apply(server raft.Server) (interface{}, error)
func (*ChangeDbUserPermissions) CommandName ¶
func (c *ChangeDbUserPermissions) CommandName() string
type ContinuousQueryWriter ¶
type ContinuousQueryWriter struct {
// contains filtered or unexported fields
}
func NewContinuousQueryWriter ¶
func NewContinuousQueryWriter( c *Coordinator, db, target string, query *parser.SelectQuery, ) *ContinuousQueryWriter
func (*ContinuousQueryWriter) Close ¶
func (self *ContinuousQueryWriter) Close() error
func (*ContinuousQueryWriter) Name ¶ added in v0.8.4
func (self *ContinuousQueryWriter) Name() string
func (*ContinuousQueryWriter) Next ¶ added in v0.8.6
func (self *ContinuousQueryWriter) Next() engine.Processor
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
func NewCoordinator ¶ added in v0.8.4
func NewCoordinator( config *configuration.Configuration, raftServer *RaftServer, clusterConfiguration *cluster.ClusterConfiguration) *Coordinator
func (*Coordinator) AuthenticateClusterAdmin ¶ added in v0.8.4
func (self *Coordinator) AuthenticateClusterAdmin(username, password string) (common.User, error)
func (*Coordinator) AuthenticateDbUser ¶ added in v0.8.4
func (self *Coordinator) AuthenticateDbUser(db, username, password string) (common.User, error)
func (*Coordinator) ChangeClusterAdminPassword ¶ added in v0.8.4
func (self *Coordinator) ChangeClusterAdminPassword(requester common.User, username, password string) error
func (*Coordinator) ChangeDbUserPassword ¶ added in v0.8.4
func (self *Coordinator) ChangeDbUserPassword(requester common.User, db, username, password string) error
func (*Coordinator) ChangeDbUserPermissions ¶ added in v0.8.4
func (self *Coordinator) ChangeDbUserPermissions(requester common.User, db, username, readPermissions, writePermissions string) error
func (*Coordinator) CommitSeriesData ¶ added in v0.8.4
func (*Coordinator) ConnectToProtobufServers ¶ added in v0.8.4
func (self *Coordinator) ConnectToProtobufServers(localRaftName string) error
func (*Coordinator) CreateClusterAdminUser ¶ added in v0.8.4
func (self *Coordinator) CreateClusterAdminUser(requester common.User, username, password string) error
func (*Coordinator) CreateDatabase ¶
func (self *Coordinator) CreateDatabase(user common.User, db string) error
func (*Coordinator) CreateDbUser ¶ added in v0.8.4
func (*Coordinator) DeleteClusterAdminUser ¶ added in v0.8.4
func (self *Coordinator) DeleteClusterAdminUser(requester common.User, username string) error
func (*Coordinator) DeleteDbUser ¶ added in v0.8.4
func (self *Coordinator) DeleteDbUser(requester common.User, db, username string) error
func (*Coordinator) DropDatabase ¶
func (self *Coordinator) DropDatabase(user common.User, db string) error
func (*Coordinator) ForceCompaction ¶
func (self *Coordinator) ForceCompaction(user common.User) error
func (*Coordinator) InterpolateValuesAndCommit ¶ added in v0.8.4
func (*Coordinator) ListClusterAdmins ¶ added in v0.8.4
func (self *Coordinator) ListClusterAdmins(requester common.User) ([]string, error)
func (*Coordinator) ListContinuousQueries ¶
func (*Coordinator) ListDatabases ¶
func (*Coordinator) ListDbUsers ¶ added in v0.8.4
func (*Coordinator) ProcessContinuousQueries ¶ added in v0.8.4
func (self *Coordinator) ProcessContinuousQueries(db string, series *protocol.Series)
func (*Coordinator) SetDbAdmin ¶ added in v0.8.4
func (*Coordinator) WriteSeriesData ¶
type CreateContinuousQueryCommand ¶
type CreateContinuousQueryCommand struct { Database string `json:"database"` Query string `json:"query"` }
func NewCreateContinuousQueryCommand ¶
func NewCreateContinuousQueryCommand(database string, query string) *CreateContinuousQueryCommand
func (*CreateContinuousQueryCommand) Apply ¶
func (c *CreateContinuousQueryCommand) Apply(server raft.Server) (interface{}, error)
func (*CreateContinuousQueryCommand) CommandName ¶
func (c *CreateContinuousQueryCommand) CommandName() string
type CreateDatabaseCommand ¶
type CreateDatabaseCommand struct {
Name string `json:"name"`
}
func NewCreateDatabaseCommand ¶
func NewCreateDatabaseCommand(name string) *CreateDatabaseCommand
func (*CreateDatabaseCommand) Apply ¶
func (c *CreateDatabaseCommand) Apply(server raft.Server) (interface{}, error)
func (*CreateDatabaseCommand) CommandName ¶
func (c *CreateDatabaseCommand) CommandName() string
type CreateSeriesFieldIdsCommand ¶
func NewCreateSeriesFieldIdsCommand ¶
func NewCreateSeriesFieldIdsCommand(database string, series []*protocol.Series) *CreateSeriesFieldIdsCommand
func (*CreateSeriesFieldIdsCommand) Apply ¶
func (c *CreateSeriesFieldIdsCommand) Apply(server raft.Server) (interface{}, error)
func (*CreateSeriesFieldIdsCommand) CommandName ¶
func (c *CreateSeriesFieldIdsCommand) CommandName() string
type CreateShardSpaceCommand ¶
type CreateShardSpaceCommand struct {
ShardSpace *cluster.ShardSpace
}
func NewCreateShardSpaceCommand ¶
func NewCreateShardSpaceCommand(space *cluster.ShardSpace) *CreateShardSpaceCommand
func (*CreateShardSpaceCommand) Apply ¶
func (c *CreateShardSpaceCommand) Apply(server raft.Server) (interface{}, error)
func (*CreateShardSpaceCommand) CommandName ¶
func (c *CreateShardSpaceCommand) CommandName() string
type CreateShardsCommand ¶
type CreateShardsCommand struct { Shards []*cluster.NewShardData SpaceName string }
func NewCreateShardsCommand ¶
func NewCreateShardsCommand(shards []*cluster.NewShardData) *CreateShardsCommand
func (*CreateShardsCommand) Apply ¶
func (c *CreateShardsCommand) Apply(server raft.Server) (interface{}, error)
func (*CreateShardsCommand) CommandName ¶
func (c *CreateShardsCommand) CommandName() string
type DeleteContinuousQueryCommand ¶
type DeleteContinuousQueryCommand struct { Database string `json:"database"` Id uint32 `json:"id"` }
func NewDeleteContinuousQueryCommand ¶
func NewDeleteContinuousQueryCommand(database string, id uint32) *DeleteContinuousQueryCommand
func (*DeleteContinuousQueryCommand) Apply ¶
func (c *DeleteContinuousQueryCommand) Apply(server raft.Server) (interface{}, error)
func (*DeleteContinuousQueryCommand) CommandName ¶
func (c *DeleteContinuousQueryCommand) CommandName() string
type DropDatabaseCommand ¶
type DropDatabaseCommand struct {
Name string `json:"name"`
}
func NewDropDatabaseCommand ¶
func NewDropDatabaseCommand(name string) *DropDatabaseCommand
func (*DropDatabaseCommand) Apply ¶
func (c *DropDatabaseCommand) Apply(server raft.Server) (interface{}, error)
func (*DropDatabaseCommand) CommandName ¶
func (c *DropDatabaseCommand) CommandName() string
type DropSeriesCommand ¶
func NewDropSeriesCommand ¶
func NewDropSeriesCommand(database, series string) *DropSeriesCommand
func (*DropSeriesCommand) Apply ¶
func (c *DropSeriesCommand) Apply(server raft.Server) (interface{}, error)
func (*DropSeriesCommand) CommandName ¶
func (c *DropSeriesCommand) CommandName() string
type DropShardCommand ¶
func NewDropShardCommand ¶
func NewDropShardCommand(id uint32, serverIds []uint32) *DropShardCommand
func (*DropShardCommand) Apply ¶
func (c *DropShardCommand) Apply(server raft.Server) (interface{}, error)
func (*DropShardCommand) CommandName ¶
func (c *DropShardCommand) CommandName() string
type DropShardSpaceCommand ¶
func NewDropShardSpaceCommand ¶
func NewDropShardSpaceCommand(database, name string) *DropShardSpaceCommand
func (*DropShardSpaceCommand) Apply ¶
func (c *DropShardSpaceCommand) Apply(server raft.Server) (interface{}, error)
func (*DropShardSpaceCommand) CommandName ¶
func (c *DropShardSpaceCommand) CommandName() string
type InfluxChangeConnectionStringCommand ¶
type InfluxChangeConnectionStringCommand struct { Name string `json:"name"` Force bool `json:"force"` ConnectionString string `json:"connectionString"` ProtobufConnectionString string `json:"protobufConnectionString"` }
func (*InfluxChangeConnectionStringCommand) Apply ¶
func (c *InfluxChangeConnectionStringCommand) Apply(server raft.Server) (interface{}, error)
func (*InfluxChangeConnectionStringCommand) CommandName ¶
func (c *InfluxChangeConnectionStringCommand) CommandName() string
The name of the ChangeConnectionString command in the log
func (*InfluxChangeConnectionStringCommand) NodeName ¶
func (c *InfluxChangeConnectionStringCommand) NodeName() string
type InfluxForceLeaveCommand ¶
type InfluxForceLeaveCommand struct {
Id uint32 `json:"id"`
}
func (*InfluxForceLeaveCommand) Apply ¶
func (c *InfluxForceLeaveCommand) Apply(server raft.Server) (interface{}, error)
func (*InfluxForceLeaveCommand) CommandName ¶
func (c *InfluxForceLeaveCommand) CommandName() string
The name of the ForceLeave command in the log
type InfluxJoinCommand ¶
type InfluxJoinCommand struct { Name string `json:"name"` ConnectionString string `json:"connectionString"` ProtobufConnectionString string `json:"protobufConnectionString"` }
func (*InfluxJoinCommand) Apply ¶
func (c *InfluxJoinCommand) Apply(server raft.Server) (interface{}, error)
func (*InfluxJoinCommand) CommandName ¶
func (c *InfluxJoinCommand) CommandName() string
The name of the Join command in the log
func (*InfluxJoinCommand) NodeName ¶
func (c *InfluxJoinCommand) NodeName() string
type MergeChannelProcessor ¶ added in v0.8.4
type MergeChannelProcessor struct {
// contains filtered or unexported fields
}
This struct is responsible for merging responses from multiple response channels and controlling the concurrency of querying by giving away `concurrency' channels at any given time. This is used in the coordinator to merge the responses received from different shards, which could be remote or local.
func NewMergeChannelProcessor ¶ added in v0.8.4
func NewMergeChannelProcessor(next engine.Processor, concurrency int) *MergeChannelProcessor
Return a new MergeChannelProcessor that will yield to `next'
func (*MergeChannelProcessor) Close ¶ added in v0.8.4
func (p *MergeChannelProcessor) Close() (err error)
Closes MergeChannelProcessor, this method has to make sure that all responses are received from the response channels. This is important since the protobuf client may block trying to insert a new response which will cause the entire node to stop receiving remote responses.
func (*MergeChannelProcessor) NextChannel ¶ added in v0.8.4
func (p *MergeChannelProcessor) NextChannel(bs int) (chan<- *protocol.Response, error)
Returns a new channel with buffer size `bs'. This method will block until there are channels available to return. Remember MergeChannelProcessor controls the concurrency of the query by guaranteeing no more than `concurrency' channels are given away at any given time.
func (*MergeChannelProcessor) ProcessChannels ¶ added in v0.8.4
func (p *MergeChannelProcessor) ProcessChannels()
Start processing the channels that are yielded by NextChannel() and yield the Series in the responses to the next Process.
func (*MergeChannelProcessor) String ¶ added in v0.8.4
func (p *MergeChannelProcessor) String() string
type Permissions ¶
type Permissions struct{}
func (*Permissions) AuthorizeChangeClusterAdminPassword ¶
func (self *Permissions) AuthorizeChangeClusterAdminPassword(user common.User) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeChangeDbUserPassword ¶
func (self *Permissions) AuthorizeChangeDbUserPassword(user common.User, db string, targetUsername string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeChangeDbUserPermissions ¶
func (self *Permissions) AuthorizeChangeDbUserPermissions(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeCreateClusterAdmin ¶
func (self *Permissions) AuthorizeCreateClusterAdmin(user common.User) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeCreateContinuousQuery ¶
func (self *Permissions) AuthorizeCreateContinuousQuery(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeCreateDatabase ¶
func (self *Permissions) AuthorizeCreateDatabase(user common.User) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeCreateDbUser ¶
func (self *Permissions) AuthorizeCreateDbUser(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeDeleteClusterAdmin ¶
func (self *Permissions) AuthorizeDeleteClusterAdmin(user common.User) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeDeleteContinuousQuery ¶
func (self *Permissions) AuthorizeDeleteContinuousQuery(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeDeleteDbUser ¶
func (self *Permissions) AuthorizeDeleteDbUser(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeDeleteQuery ¶
func (self *Permissions) AuthorizeDeleteQuery(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeDropDatabase ¶
func (self *Permissions) AuthorizeDropDatabase(user common.User) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeDropSeries ¶
func (self *Permissions) AuthorizeDropSeries(user common.User, db string, seriesName string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeGetDbUser ¶
func (self *Permissions) AuthorizeGetDbUser(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeGrantDbUserAdmin ¶
func (self *Permissions) AuthorizeGrantDbUserAdmin(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeListClusterAdmins ¶
func (self *Permissions) AuthorizeListClusterAdmins(user common.User) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeListContinuousQueries ¶
func (self *Permissions) AuthorizeListContinuousQueries(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeListDatabases ¶
func (self *Permissions) AuthorizeListDatabases(user common.User) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeListDbUsers ¶
func (self *Permissions) AuthorizeListDbUsers(user common.User, db string) (ok bool, err common.AuthorizationError)
func (*Permissions) AuthorizeSelectQuery ¶ added in v0.8.4
func (self *Permissions) AuthorizeSelectQuery(user common.User, db string, querySpec *parser.QuerySpec) (ok bool, err common.AuthorizationError)
func (*Permissions) CheckQueryPermissions ¶ added in v0.8.4
func (self *Permissions) CheckQueryPermissions(user common.User, db string, querySpec *parser.QuerySpec) (ok bool, err common.AuthorizationError)
type ProtobufClient ¶
type ProtobufClient struct {
// contains filtered or unexported fields
}
func NewProtobufClient ¶
func NewProtobufClient(hostAndPort string, writeTimeout time.Duration) *ProtobufClient
func (*ProtobufClient) CancelRequest ¶ added in v0.8.4
func (self *ProtobufClient) CancelRequest(request *protocol.Request)
func (*ProtobufClient) ClearRequests ¶
func (self *ProtobufClient) ClearRequests()
func (*ProtobufClient) Close ¶
func (self *ProtobufClient) Close()
func (*ProtobufClient) Connect ¶
func (self *ProtobufClient) Connect()
func (*ProtobufClient) MakeRequest ¶
func (self *ProtobufClient) MakeRequest(request *protocol.Request, r cluster.ResponseChannel) error
Makes a request to the server. If the responseStream chan is not nil it will expect a response from the server with a matching request.Id. The REQUEST_RETRY_ATTEMPTS constant of 3 and the RECONNECT_RETRY_WAIT of 100ms means that an attempt to make a request to a downed server will take 300ms to time out.
type ProtobufRequestHandler ¶
type ProtobufRequestHandler struct {
// contains filtered or unexported fields
}
func NewProtobufRequestHandler ¶
func NewProtobufRequestHandler(coordinator *Coordinator, clusterConfig *cluster.ClusterConfiguration) *ProtobufRequestHandler
func (*ProtobufRequestHandler) HandleRequest ¶
func (*ProtobufRequestHandler) WriteResponse ¶
type ProtobufServer ¶
type ProtobufServer struct {
// contains filtered or unexported fields
}
func NewProtobufServer ¶
func NewProtobufServer(port string, requestHandler Handler) *ProtobufServer
func (*ProtobufServer) Close ¶
func (self *ProtobufServer) Close()
func (*ProtobufServer) ListenAndServe ¶
func (self *ProtobufServer) ListenAndServe()
type RaftServer ¶
type RaftServer struct {
// contains filtered or unexported fields
}
The raftd server is a combination of the Raft server and an HTTP server which acts as the transport.
func NewRaftServer ¶
func NewRaftServer(config *configuration.Configuration, clusterConfig *cluster.ClusterConfiguration) *RaftServer
Creates a new server.
func (*RaftServer) AssignCoordinator ¶
func (s *RaftServer) AssignCoordinator(coordinator *Coordinator) error
func (*RaftServer) ChangeConnectionString ¶
func (s *RaftServer) ChangeConnectionString(raftName, protobufConnectionString, raftConnectionString string, forced bool) error
func (*RaftServer) ChangeDbUserPassword ¶
func (s *RaftServer) ChangeDbUserPassword(db, username string, hash []byte) error
func (*RaftServer) ChangeDbUserPermissions ¶
func (s *RaftServer) ChangeDbUserPermissions(db, username, readPermissions, writePermissions string) error
func (*RaftServer) Close ¶
func (self *RaftServer) Close()
func (*RaftServer) CommittedAllChanges ¶
func (s *RaftServer) CommittedAllChanges() bool
func (*RaftServer) CompactLog ¶
func (s *RaftServer) CompactLog()
func (*RaftServer) CreateContinuousQuery ¶
func (s *RaftServer) CreateContinuousQuery(db string, query string) error
func (*RaftServer) CreateDatabase ¶
func (s *RaftServer) CreateDatabase(name string) error
func (*RaftServer) CreateRootUser ¶
func (s *RaftServer) CreateRootUser() error
func (*RaftServer) CreateShardSpace ¶
func (self *RaftServer) CreateShardSpace(shardSpace *cluster.ShardSpace) error
func (*RaftServer) CreateShards ¶
func (self *RaftServer) CreateShards(shards []*cluster.NewShardData) ([]*cluster.ShardData, error)
func (*RaftServer) DeleteContinuousQuery ¶
func (s *RaftServer) DeleteContinuousQuery(db string, id uint32) error
func (*RaftServer) DropDatabase ¶
func (s *RaftServer) DropDatabase(name string) error
func (*RaftServer) DropSeries ¶
func (self *RaftServer) DropSeries(database, series string) error
func (*RaftServer) DropShard ¶
func (self *RaftServer) DropShard(id uint32, serverIds []uint32) error
func (*RaftServer) DropShardSpace ¶
func (self *RaftServer) DropShardSpace(database, name string) error
func (*RaftServer) ForceLogCompaction ¶
func (s *RaftServer) ForceLogCompaction() error
func (*RaftServer) GetLeaderRaftConnectString ¶ added in v0.8.1
func (s *RaftServer) GetLeaderRaftConnectString() (string, bool)
* * return a consistant leader raft connection string when called on all living nodes include leader.
func (*RaftServer) GetLeaderRaftName ¶
func (s *RaftServer) GetLeaderRaftName() string
func (*RaftServer) GetOrSetFieldIdsForSeries ¶
func (*RaftServer) GetRaftName ¶
func (s *RaftServer) GetRaftName() string
func (*RaftServer) HandleFunc ¶
func (s *RaftServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
This is a hack around Gorilla mux not providing the correct net/http HandleFunc() interface.
func (*RaftServer) IsLeaderByRaftName ¶
func (s *RaftServer) IsLeaderByRaftName(name string) bool
func (*RaftServer) Join ¶
func (s *RaftServer) Join(leader string) error
Joins to the leader of an existing cluster.
func (*RaftServer) ListenAndServe ¶
func (s *RaftServer) ListenAndServe() error
func (*RaftServer) RemoveServer ¶
func (s *RaftServer) RemoveServer(id uint32) error
Joins to the leader of an existing cluster.
func (*RaftServer) SaveClusterAdminUser ¶
func (s *RaftServer) SaveClusterAdminUser(u *cluster.ClusterAdmin) error
func (*RaftServer) SaveDbUser ¶
func (s *RaftServer) SaveDbUser(u *cluster.DbUser) error
func (*RaftServer) SetContinuousQueryTimestamp ¶
func (s *RaftServer) SetContinuousQueryTimestamp(timestamp time.Time) error
func (*RaftServer) StartProcessingContinuousQueries ¶
func (s *RaftServer) StartProcessingContinuousQueries()
func (*RaftServer) UpdateShardSpace ¶ added in v0.8.2
func (self *RaftServer) UpdateShardSpace(shardSpace *cluster.ShardSpace) error
type SaveClusterAdminCommand ¶
type SaveClusterAdminCommand struct {
User *cluster.ClusterAdmin `json:"user"`
}
func NewSaveClusterAdminCommand ¶
func NewSaveClusterAdminCommand(u *cluster.ClusterAdmin) *SaveClusterAdminCommand
func (*SaveClusterAdminCommand) Apply ¶
func (c *SaveClusterAdminCommand) Apply(server raft.Server) (interface{}, error)
func (*SaveClusterAdminCommand) CommandName ¶
func (c *SaveClusterAdminCommand) CommandName() string
type SaveDbUserCommand ¶
func NewSaveDbUserCommand ¶
func NewSaveDbUserCommand(u *cluster.DbUser) *SaveDbUserCommand
func (*SaveDbUserCommand) Apply ¶
func (c *SaveDbUserCommand) Apply(server raft.Server) (interface{}, error)
func (*SaveDbUserCommand) CommandName ¶
func (c *SaveDbUserCommand) CommandName() string
type SetContinuousQueryTimestampCommand ¶
func NewSetContinuousQueryTimestampCommand ¶
func NewSetContinuousQueryTimestampCommand(timestamp time.Time) *SetContinuousQueryTimestampCommand
func (*SetContinuousQueryTimestampCommand) Apply ¶
func (c *SetContinuousQueryTimestampCommand) Apply(server raft.Server) (interface{}, error)
func (*SetContinuousQueryTimestampCommand) CommandName ¶
func (c *SetContinuousQueryTimestampCommand) CommandName() string
type ShardAwareObject ¶
type ShardAwareObject interface { GetShards(querySpec *parser.QuerySpec) []cluster.Shard // returns true if results from shards can just be ordered. false if the results are raw points that // need to be sent through the query engine CanCollateShards(querySpec *parser.QuerySpec) bool GetShardById(id uint32) cluster.Shard GetShardToWriteToBySeriesAndTime(db, series string, microsecondsEpoch int64) (cluster.Shard, error) }
These are things that the Coordinator need (defined in Coordinator, will have to import cluster package)
type UpdateShardSpaceCommand ¶ added in v0.8.2
type UpdateShardSpaceCommand struct {
ShardSpace *cluster.ShardSpace
}
func NewUpdateShardSpaceCommand ¶ added in v0.8.2
func NewUpdateShardSpaceCommand(space *cluster.ShardSpace) *UpdateShardSpaceCommand
func (*UpdateShardSpaceCommand) Apply ¶ added in v0.8.2
func (c *UpdateShardSpaceCommand) Apply(server raft.Server) (interface{}, error)
func (*UpdateShardSpaceCommand) CommandName ¶ added in v0.8.2
func (c *UpdateShardSpaceCommand) CommandName() string