Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

*: add license header #182

Merged
merged 5 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {}
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@ Apache License
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 2 additions & 0 deletions cmd/backup.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package cmd

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package cmd

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/restore.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package cmd

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/validate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package cmd

import (
Expand Down
12 changes: 8 additions & 4 deletions pkg/rtree/check.go → pkg/backup/check.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package rtree
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
"encoding/hex"

"github.com/google/btree"
"github.com/pingcap/log"
"go.uber.org/zap"

"github.com/pingcap/br/pkg/rtree"
)

// CheckDupFiles checks if there are any files are duplicated.
func CheckDupFiles(rangeTree *RangeTree) {
// checkDupFiles checks if there are any files are duplicated.
func checkDupFiles(rangeTree *rtree.RangeTree) {
// Name -> SHA256
files := make(map[string][]byte)
rangeTree.Ascend(func(i btree.Item) bool {
rg := i.(*Range)
rg := i.(*rtree.Range)
for _, f := range rg.Files {
old, ok := files[f.Name]
if ok {
Expand Down
4 changes: 3 additions & 1 deletion pkg/backup/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
Expand Down Expand Up @@ -429,7 +431,7 @@ func (bc *Client) BackupRange(
})

// Check if there are duplicated files.
rtree.CheckDupFiles(&results)
checkDupFiles(&results)

return nil
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/backup/client_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/backup/metrics.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/backup/push.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/backup/safe_point.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/backup/safe_point_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/backup/schema.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/backup/schema_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package backup

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/checksum/executor.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package checksum

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/checksum/executor_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package checksum

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/conn/conn.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package conn

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/conn/conn_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package conn

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/glue/glue.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package glue

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/gluetidb/glue.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package gluetidb

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/mock/mock_cluster.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package mock

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/mock/mock_cluster_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package mock

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/backoff.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/backoff_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/client_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/db.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/db_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/import.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/range.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/range_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/split.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/split_client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/split_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/util.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/restore/util_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package restore

import (
Expand Down
13 changes: 1 addition & 12 deletions pkg/rtree/rtree.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
// Copyright 2020 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package rtree

Expand Down
13 changes: 1 addition & 12 deletions pkg/rtree/rtree_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
// Copyright 2020 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package rtree

Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/flags.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/gcs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/gcs_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/local.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/local_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

// +build !windows

package storage
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/local_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

// +build windows

package storage
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/noop.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import "context"
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/parse.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/parse_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/s3.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/s3_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/storage/storage.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package storage

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/summary/collector.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package summary

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/summary/collector_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package summary

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/summary/summary.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package summary

import "time"
Expand Down
2 changes: 2 additions & 0 deletions pkg/task/backup.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package task

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/task/backup_raw.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package task

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/task/common.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.

package task

import (
Expand Down
Loading