Documentation ¶
Index ¶
- Constants
- Variables
- func SendCommandToServer(url string, command raft.Command) (interface{}, error)
- type ChangeDbUserPassword
- type ChangeDbUserPermissions
- type ClusterConsensus
- type ContinuousQueryWriter
- type Coordinator
- type CoordinatorImpl
- func (self *CoordinatorImpl) AuthenticateClusterAdmin(username, password string) (common.User, error)
- func (self *CoordinatorImpl) AuthenticateDbUser(db, username, password string) (common.User, error)
- func (self *CoordinatorImpl) ChangeClusterAdminPassword(requester common.User, username, password string) error
- func (self *CoordinatorImpl) ChangeDbUserPassword(requester common.User, db, username, password string) error
- func (self *CoordinatorImpl) ChangeDbUserPermissions(requester common.User, db, username, readPermissions, writePermissions string) error
- func (self *CoordinatorImpl) CommitSeriesData(db string, serieses []*protocol.Series, sync bool) error
- func (self *CoordinatorImpl) ConnectToProtobufServers(localRaftName string) error
- func (self *CoordinatorImpl) CreateClusterAdminUser(requester common.User, username, password string) error
- func (self *CoordinatorImpl) CreateContinuousQuery(user common.User, db string, query string) error
- func (self *CoordinatorImpl) CreateDatabase(user common.User, db string) error
- func (self *CoordinatorImpl) CreateDbUser(requester common.User, db, username, password string, permissions ...string) error
- func (self *CoordinatorImpl) DeleteClusterAdminUser(requester common.User, username string) error
- func (self *CoordinatorImpl) DeleteContinuousQuery(user common.User, db string, id uint32) error
- func (self *CoordinatorImpl) DeleteDbUser(requester common.User, db, username string) error
- func (self *CoordinatorImpl) DropDatabase(user common.User, db string) error
- func (self *CoordinatorImpl) ForceCompaction(user common.User) error
- func (self *CoordinatorImpl) GetDbUser(requester common.User, db string, username string) (common.User, error)
- func (self *CoordinatorImpl) InterpolateValuesAndCommit(query string, db string, series *protocol.Series, targetName string, ...) error
- func (self *CoordinatorImpl) ListClusterAdmins(requester common.User) ([]string, error)
- func (self *CoordinatorImpl) ListContinuousQueries(user common.User, db string) ([]*protocol.Series, error)
- func (self *CoordinatorImpl) ListDatabases(user common.User) ([]*cluster.Database, error)
- func (self *CoordinatorImpl) ListDbUsers(requester common.User, db string) ([]common.User, error)
- func (self *CoordinatorImpl) ProcessContinuousQueries(db string, series *protocol.Series)
- func (self *CoordinatorImpl) RunContinuousQuery(user common.User, db string, query string) error
- func (self *CoordinatorImpl) RunQuery(user common.User, database string, queryString string, ...) (err error)
- func (self *CoordinatorImpl) SetDbAdmin(requester common.User, db, username string, isAdmin bool) error
- func (self *CoordinatorImpl) 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 InfluxChangeConnectionStringCommand
- type InfluxForceLeaveCommand
- type InfluxJoinCommand
- type Metastore
- 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)
- type ProtobufClient
- type ProtobufRequestHandler
- type ProtobufServer
- type RaftServer
- func (s *RaftServer) AssignCoordinator(coordinator *CoordinatorImpl) 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 RequestHandler
- type SaveClusterAdminCommand
- type SaveDbUserCommand
- type SeriesWriter
- type SetContinuousQueryTimestampCommand
- type ShardAwareObject
- type UpdateShardSpaceCommand
Constants ¶
const ( // this is the key used for the persistent atomic ints for sequence numbers POINT_SEQUENCE_NUMBER_KEY = "p" // actual point sequence numbers will have the first part of the number // be a host id. This ensures that sequence numbers are unique across the cluster HOST_ID_OFFSET = uint64(10000) SHARDS_TO_QUERY_FOR_LIST_SERIES = 10 )
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 ¶
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 ClusterConsensus ¶
type ClusterConsensus interface { CreateDatabase(name string) error DropDatabase(name string) error DropSeries(database, series string) error CreateContinuousQuery(db string, query string) error DeleteContinuousQuery(db string, id uint32) error SaveClusterAdminUser(u *cluster.ClusterAdmin) error SaveDbUser(user *cluster.DbUser) error ChangeDbUserPassword(db, username string, hash []byte) error ChangeDbUserPermissions(db, username, readPermissions, writePermissions string) error AssignCoordinator(coordinator *CoordinatorImpl) error // When a cluster is turned on for the first time. CreateRootUser() error ForceLogCompaction() error }
type ContinuousQueryWriter ¶
type ContinuousQueryWriter struct {
// contains filtered or unexported fields
}
func NewContinuousQueryWriter ¶
func NewContinuousQueryWriter(yield func(*protocol.Series) error) *ContinuousQueryWriter
func (*ContinuousQueryWriter) Close ¶
func (self *ContinuousQueryWriter) Close()
type Coordinator ¶
type Coordinator interface { // Assumption about the returned data: // 1. For any given time series, the points returned are in order // 2. If the query involves more than one time series, there is no // guarantee on the order in whic they are returned // 3. Data is filtered, i.e. where clause should be assumed to hold true // for all the data points that are returned // 4. The end of a time series is signaled by returning a series with no data points // 5. TODO: Aggregation on the nodes WriteSeriesData(user common.User, db string, series []*protocol.Series) error DropDatabase(user common.User, db string) error CreateDatabase(user common.User, db string) error ForceCompaction(user common.User) error ListDatabases(user common.User) ([]*cluster.Database, error) DeleteContinuousQuery(user common.User, db string, id uint32) error CreateContinuousQuery(user common.User, db string, query string) error ListContinuousQueries(user common.User, db string) ([]*protocol.Series, error) // v2 clustering, based on sharding instead of the circular hash ring RunQuery(user common.User, db, query string, seriesWriter SeriesWriter) error }
type CoordinatorImpl ¶
type CoordinatorImpl struct {
// contains filtered or unexported fields
}
func NewCoordinatorImpl ¶
func NewCoordinatorImpl( config *configuration.Configuration, raftServer ClusterConsensus, clusterConfiguration *cluster.ClusterConfiguration, metastore Metastore) *CoordinatorImpl
func (*CoordinatorImpl) AuthenticateClusterAdmin ¶
func (self *CoordinatorImpl) AuthenticateClusterAdmin(username, password string) (common.User, error)
func (*CoordinatorImpl) AuthenticateDbUser ¶
func (self *CoordinatorImpl) AuthenticateDbUser(db, username, password string) (common.User, error)
func (*CoordinatorImpl) ChangeClusterAdminPassword ¶
func (self *CoordinatorImpl) ChangeClusterAdminPassword(requester common.User, username, password string) error
func (*CoordinatorImpl) ChangeDbUserPassword ¶
func (self *CoordinatorImpl) ChangeDbUserPassword(requester common.User, db, username, password string) error
func (*CoordinatorImpl) ChangeDbUserPermissions ¶
func (self *CoordinatorImpl) ChangeDbUserPermissions(requester common.User, db, username, readPermissions, writePermissions string) error
func (*CoordinatorImpl) CommitSeriesData ¶
func (*CoordinatorImpl) ConnectToProtobufServers ¶
func (self *CoordinatorImpl) ConnectToProtobufServers(localRaftName string) error
func (*CoordinatorImpl) CreateClusterAdminUser ¶
func (self *CoordinatorImpl) CreateClusterAdminUser(requester common.User, username, password string) error
func (*CoordinatorImpl) CreateContinuousQuery ¶
func (*CoordinatorImpl) CreateDatabase ¶
func (self *CoordinatorImpl) CreateDatabase(user common.User, db string) error
func (*CoordinatorImpl) CreateDbUser ¶
func (*CoordinatorImpl) DeleteClusterAdminUser ¶
func (self *CoordinatorImpl) DeleteClusterAdminUser(requester common.User, username string) error
func (*CoordinatorImpl) DeleteContinuousQuery ¶
TODO: this is for backward compatability only, remove after 0.8
func (*CoordinatorImpl) DeleteDbUser ¶
func (self *CoordinatorImpl) DeleteDbUser(requester common.User, db, username string) error
func (*CoordinatorImpl) DropDatabase ¶
func (self *CoordinatorImpl) DropDatabase(user common.User, db string) error
func (*CoordinatorImpl) ForceCompaction ¶
func (self *CoordinatorImpl) ForceCompaction(user common.User) error
func (*CoordinatorImpl) InterpolateValuesAndCommit ¶
func (*CoordinatorImpl) ListClusterAdmins ¶
func (self *CoordinatorImpl) ListClusterAdmins(requester common.User) ([]string, error)
func (*CoordinatorImpl) ListContinuousQueries ¶
func (*CoordinatorImpl) ListDatabases ¶
func (*CoordinatorImpl) ListDbUsers ¶
func (*CoordinatorImpl) ProcessContinuousQueries ¶
func (self *CoordinatorImpl) ProcessContinuousQueries(db string, series *protocol.Series)
func (*CoordinatorImpl) RunContinuousQuery ¶ added in v0.8.3
func (*CoordinatorImpl) RunQuery ¶
func (self *CoordinatorImpl) RunQuery(user common.User, database string, queryString string, seriesWriter SeriesWriter) (err error)
func (*CoordinatorImpl) SetDbAdmin ¶
func (*CoordinatorImpl) 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 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)
type ProtobufClient ¶
type ProtobufClient struct {
// contains filtered or unexported fields
}
func NewProtobufClient ¶
func NewProtobufClient(hostAndPort string, writeTimeout time.Duration) *ProtobufClient
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, responseStream chan *protocol.Response) 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 RequestHandler) *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 *CoordinatorImpl) 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 RequestHandler ¶
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 SeriesWriter ¶
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