func NewServer(store datastore.Datastore, config clustering.ConfigurationStore, acctng accounting.AccountingStore, namespace string, readonly bool, channel, plusChannel RequestChannel, servicers, plusServicers, maxParallelism int, timeout time.Duration, signature, metrics bool, enterprise bool) (*Server, errors.Error) { rv := &Server{ datastore: store, configstore: config, acctstore: acctng, namespace: namespace, readonly: readonly, channel: channel, plusChannel: plusChannel, signature: signature, timeout: timeout, metrics: metrics, done: make(chan bool), plusDone: make(chan bool), enterprise: enterprise, } // special case handling for the atomic specfic stuff atomic.StoreInt64(&rv.servicers, int64(servicers)) atomic.StoreInt64(&rv.plusServicers, int64(plusServicers)) store.SetLogLevel(logging.LogLevel()) rv.SetMaxParallelism(maxParallelism) sys, err := system.NewDatastore(store) if err != nil { return nil, err } rv.systemstore = sys return rv, nil }