Skip to content

Commit

Permalink
chore: tidy up license header and import order (#5720)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldming authored Nov 2, 2023
1 parent 0611409 commit dda5061
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 18 deletions.
41 changes: 29 additions & 12 deletions deploy/zookeeper/config/zookeeper-config-constraint.cue
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
// Copyright (C) 2022-2023 ApeCloud Co., Ltd
//
// This file is part of KubeBlocks project
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

#ZookeeperParameter: {
// the length of a single tick, which is the basic time unit used by ZooKeeper, as measured in milliseconds. It is used to regulate heartbeats, and timeouts. For example, the minimum session timeout will be two ticks.
"tickTime": int & >=1 & <=100000 | *2000

// Amount of time, in ticks (see tickTime), to allow followers to connect and sync to a leader. Increased this value as needed, if the amount of data managed by ZooKeeper is large.
"initLimit": int | *10
// Amount of time, in ticks (see tickTime), to allow followers to connect and sync to a leader. Increased this value as needed, if the amount of data managed by ZooKeeper is large.
"initLimit": int | *10

// Amount of time, in ticks (see tickTime), to allow followers to sync with ZooKeeper. If followers fall too far behind a leader, they will be dropped.
// Amount of time, in ticks (see tickTime), to allow followers to sync with ZooKeeper. If followers fall too far behind a leader, they will be dropped.
"syncLimit": int | *30

// the port to listen for client connections; that is, the port that clients attempt to connect to.
"clientPort": int & >=1 & <=65535 | *2181
// the port to listen for client connections; that is, the port that clients attempt to connect to.
"clientPort": int & >=1 & <=65535 | *2181

// Limits the number of concurrent connections (at the socket level) that a single client, identified by IP address, may make to a single member of the ZooKeeper ensemble. This is used to prevent certain classes of DoS attacks, including file descriptor exhaustion. The default is 60. Setting this to 0 entirely removes the limit on concurrent connections.
"maxClientCnxns"?: int
Expand All @@ -20,24 +37,24 @@
// New in 3.4.0: When enabled, ZooKeeper auto purge feature retains the autopurge.snapRetainCount most recent snapshots and the corresponding transaction logs in the dataDir and dataLogDir respectively and deletes the rest. Defaults to 3. Minimum value is 3.
"autopurge.snapRetainCount"?: int

// New in 3.4.0: The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging. Defaults to 0.
// New in 3.4.0: The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging. Defaults to 0.
"autopurge.purgeInterval"?: int

// the location where ZooKeeper will store the in-memory database snapshots and, unless specified otherwise, the transaction log of updates to the database.Be careful where you put the transaction log. A dedicated transaction log device is key to consistent good performance. Putting the log on a busy device will adversely effect performance.
// the location where ZooKeeper will store the in-memory database snapshots and, unless specified otherwise, the transaction log of updates to the database.Be careful where you put the transaction log. A dedicated transaction log device is key to consistent good performance. Putting the log on a busy device will adversely effect performance.
"dataDir": string | *"/zookeeper/data"

// This option will direct the machine to write the transaction log to the dataLogDir rather than the dataDir. This allows a dedicated log device to be used, and helps avoid competition between logging and snapshots.
// This option will direct the machine to write the transaction log to the dataLogDir rather than the dataDir. This allows a dedicated log device to be used, and helps avoid competition between logging and snapshots.
"dataLogDir": string | *"/zookeeper/log"

// When set to false, a single server can be started in replicated mode, a lone participant can run with observers, and a cluster can reconfigure down to one node, and up from one node.
// When set to false, a single server can be started in replicated mode, a lone participant can run with observers, and a cluster can reconfigure down to one node, and up from one node.
"standaloneEnabled": bool | *false

// This controls the enabling or disabling of Dynamic Reconfiguration feature
"reconfigEnabled": bool | *true

// A list of comma separated Four Letter Words commands that user wants to use
// A list of comma separated Four Letter Words commands that user wants to use
"4lw.commands.whitelist": string | *"srvr, mntr, ruok"

// Dynamic Config File
// Dynamic Config File
"dynamicConfigFile": string | *"/opt/zookeeper/conf/zoo.cfg.dynamic"
}
}
5 changes: 3 additions & 2 deletions pkg/lorry/engines/dbmanager_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions pkg/lorry/engines/kubernetes/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright (C) 2022-2023 ApeCloud Co., Ltd
This file is part of KubeBlocks project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package kubernetes

import (
Expand Down
3 changes: 2 additions & 1 deletion pkg/lorry/engines/mysql/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ import (
"strconv"
"time"

"github.com/apecloud/kubeblocks/pkg/constant"
"github.com/go-sql-driver/mysql"
"github.com/pkg/errors"
"github.com/spf13/viper"

"github.com/apecloud/kubeblocks/pkg/constant"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/lorry/engines/mysql/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ import (
"fmt"
"strings"

"github.com/apecloud/kubeblocks/pkg/lorry/engines/models"
"golang.org/x/exp/slices"

"github.com/apecloud/kubeblocks/pkg/lorry/engines/models"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/lorry/engines/postgres/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ import (
"encoding/json"
"fmt"

"github.com/apecloud/kubeblocks/pkg/lorry/engines/models"
"golang.org/x/exp/slices"

"github.com/apecloud/kubeblocks/pkg/lorry/engines/models"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/lorry/engines/redis/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
"fmt"
"strings"

"github.com/apecloud/kubeblocks/pkg/lorry/engines/models"
"golang.org/x/exp/slices"

"github.com/apecloud/kubeblocks/pkg/lorry/engines/models"
)

const (
Expand Down
19 changes: 19 additions & 0 deletions pkg/lorry/util/event.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright (C) 2022-2023 ApeCloud Co., Ltd
This file is part of KubeBlocks project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package util

import (
Expand Down

0 comments on commit dda5061

Please sign in to comment.