*: move "etcdserver/api/v3compactor"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
@ -27,8 +27,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/coreos/etcd/compactor"
|
|
||||||
"github.com/coreos/etcd/etcdserver"
|
"github.com/coreos/etcd/etcdserver"
|
||||||
|
"github.com/coreos/etcd/etcdserver/api/v3compactor"
|
||||||
"github.com/coreos/etcd/pkg/flags"
|
"github.com/coreos/etcd/pkg/flags"
|
||||||
"github.com/coreos/etcd/pkg/netutil"
|
"github.com/coreos/etcd/pkg/netutil"
|
||||||
"github.com/coreos/etcd/pkg/srv"
|
"github.com/coreos/etcd/pkg/srv"
|
||||||
@ -94,7 +94,7 @@ var (
|
|||||||
// If "AutoCompactionMode" is CompactorModePeriodic and
|
// If "AutoCompactionMode" is CompactorModePeriodic and
|
||||||
// "AutoCompactionRetention" is "1h", it automatically compacts
|
// "AutoCompactionRetention" is "1h", it automatically compacts
|
||||||
// compacts storage every hour.
|
// compacts storage every hour.
|
||||||
CompactorModePeriodic = compactor.ModePeriodic
|
CompactorModePeriodic = v3compactor.ModePeriodic
|
||||||
|
|
||||||
// CompactorModeRevision is revision-based compaction mode
|
// CompactorModeRevision is revision-based compaction mode
|
||||||
// for "Config.AutoCompactionMode" field.
|
// for "Config.AutoCompactionMode" field.
|
||||||
@ -102,7 +102,7 @@ var (
|
|||||||
// "AutoCompactionRetention" is "1000", it compacts log on
|
// "AutoCompactionRetention" is "1000", it compacts log on
|
||||||
// revision 5000 when the current revision is 6000.
|
// revision 5000 when the current revision is 6000.
|
||||||
// This runs every 5-minute if enough of logs have proceeded.
|
// This runs every 5-minute if enough of logs have proceeded.
|
||||||
CompactorModeRevision = compactor.ModeRevision
|
CompactorModeRevision = v3compactor.ModeRevision
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package compactor
|
package v3compactor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package compactor
|
package v3compactor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -12,5 +12,5 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// Package compactor implements automated policies for compacting etcd's mvcc storage.
|
// Package v3compactor implements automated policies for compacting etcd's mvcc storage.
|
||||||
package compactor
|
package v3compactor
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package compactor
|
package v3compactor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package compactor
|
package v3compactor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package compactor
|
package v3compactor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -12,7 +12,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
package compactor
|
package v3compactor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
@ -30,7 +30,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/coreos/etcd/auth"
|
"github.com/coreos/etcd/auth"
|
||||||
"github.com/coreos/etcd/compactor"
|
|
||||||
"github.com/coreos/etcd/etcdserver/api"
|
"github.com/coreos/etcd/etcdserver/api"
|
||||||
"github.com/coreos/etcd/etcdserver/api/membership"
|
"github.com/coreos/etcd/etcdserver/api/membership"
|
||||||
"github.com/coreos/etcd/etcdserver/api/snap"
|
"github.com/coreos/etcd/etcdserver/api/snap"
|
||||||
@ -39,6 +38,7 @@ import (
|
|||||||
stats "github.com/coreos/etcd/etcdserver/api/v2stats"
|
stats "github.com/coreos/etcd/etcdserver/api/v2stats"
|
||||||
"github.com/coreos/etcd/etcdserver/api/v2store"
|
"github.com/coreos/etcd/etcdserver/api/v2store"
|
||||||
"github.com/coreos/etcd/etcdserver/api/v3alarm"
|
"github.com/coreos/etcd/etcdserver/api/v3alarm"
|
||||||
|
"github.com/coreos/etcd/etcdserver/api/v3compactor"
|
||||||
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
|
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
|
||||||
"github.com/coreos/etcd/lease"
|
"github.com/coreos/etcd/lease"
|
||||||
"github.com/coreos/etcd/lease/leasehttp"
|
"github.com/coreos/etcd/lease/leasehttp"
|
||||||
@ -241,7 +241,7 @@ type EtcdServer struct {
|
|||||||
|
|
||||||
SyncTicker *time.Ticker
|
SyncTicker *time.Ticker
|
||||||
// compactor is used to auto-compact the KV.
|
// compactor is used to auto-compact the KV.
|
||||||
compactor compactor.Compactor
|
compactor v3compactor.Compactor
|
||||||
|
|
||||||
// peerRt used to send requests (version, lease) to peers.
|
// peerRt used to send requests (version, lease) to peers.
|
||||||
peerRt http.RoundTripper
|
peerRt http.RoundTripper
|
||||||
@ -568,7 +568,7 @@ func NewServer(cfg ServerConfig) (srv *EtcdServer, err error) {
|
|||||||
}
|
}
|
||||||
srv.authStore = auth.NewAuthStore(srv.getLogger(), srv.be, tp, int(cfg.BcryptCost))
|
srv.authStore = auth.NewAuthStore(srv.getLogger(), srv.be, tp, int(cfg.BcryptCost))
|
||||||
if num := cfg.AutoCompactionRetention; num != 0 {
|
if num := cfg.AutoCompactionRetention; num != 0 {
|
||||||
srv.compactor, err = compactor.New(cfg.Logger, cfg.AutoCompactionMode, num, srv.kv, srv)
|
srv.compactor, err = v3compactor.New(cfg.Logger, cfg.AutoCompactionMode, num, srv.kv, srv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user