You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by to...@apache.org on 2016/03/08 21:26:44 UTC
[1/3] incubator-kudu git commit: Remove incorrectly applied or
doubled ASF license headers
Repository: incubator-kudu
Updated Branches:
refs/heads/master b37003420 -> ebb371335
Remove incorrectly applied or doubled ASF license headers
The source header policy[1] says that you should not prepend the Apache
License when distributing work that is derived from projects under other
licenses. We have bits and pieces of code from LevelDB and RocksDB (BSD
license) which we'd previously prepended the ASF license to, but instead
should just keep the original license.
I briefly checked the 'git blame' on these files to see the extent to which
we'd modified them, and in some cases it was around 40-50% of the lines of
code, but none was rewritten to the extent that it's worth starting a discussion
on the subtleties of "major" vs "minor" modifications.
This also removes some cases in which we'd applied the Apache license twice
to the same piece of code -- in all cases in code we'd imported from Impala
at some point along the line after it was Apache licensed.
Change-Id: I8d8e781b672764a84792203b09e85c67e535dd11
Reviewed-on: http://gerrit.cloudera.org:8080/2484
Reviewed-by: Mike Percy <mp...@apache.org>
Tested-by: Kudu Jenkins
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/51463bcf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/51463bcf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/51463bcf
Branch: refs/heads/master
Commit: 51463bcf6cca7e99439bb796a35d43560bfc9bcc
Parents: b370034
Author: Todd Lipcon <to...@apache.org>
Authored: Tue Mar 8 09:58:15 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue Mar 8 20:25:06 2016 +0000
----------------------------------------------------------------------
build-support/release/rat_exclude_files.txt | 6 ++++++
src/kudu/server/default-path-handlers.cc | 12 ------------
src/kudu/server/default-path-handlers.h | 12 ------------
src/kudu/server/pprof-path-handlers.cc | 13 ------------
src/kudu/server/pprof-path-handlers.h | 13 ------------
src/kudu/server/webserver.cc | 13 ------------
src/kudu/server/webserver.h | 12 ------------
src/kudu/util/bit-stream-utils.h | 14 -------------
src/kudu/util/bit-stream-utils.inline.h | 14 -------------
src/kudu/util/bit-util-test.cc | 13 ------------
src/kudu/util/bit-util.h | 14 -------------
src/kudu/util/cache-test.cc | 19 +-----------------
src/kudu/util/cache.cc | 19 +-----------------
src/kudu/util/cache.h | 2 +-
src/kudu/util/logging.cc | 13 ------------
src/kudu/util/logging.h | 12 ------------
src/kudu/util/nvm_cache.cc | 23 ++++------------------
src/kudu/util/rle-encoding.h | 13 ------------
src/kudu/util/rle-test.cc | 13 ------------
src/kudu/util/status-test.cc | 19 +-----------------
src/kudu/util/sync_point.cc | 21 ++------------------
src/kudu/util/sync_point.h | 25 ++++--------------------
src/kudu/util/url-coding-test.cc | 13 ------------
src/kudu/util/url-coding.h | 13 ------------
24 files changed, 20 insertions(+), 321 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/build-support/release/rat_exclude_files.txt
----------------------------------------------------------------------
diff --git a/build-support/release/rat_exclude_files.txt b/build-support/release/rat_exclude_files.txt
index 533f914..9f38461 100644
--- a/build-support/release/rat_exclude_files.txt
+++ b/build-support/release/rat_exclude_files.txt
@@ -143,16 +143,22 @@ src/kudu/twitter-demo/example-deletes.txt
src/kudu/twitter-demo/example-tweets.txt
src/kudu/util/cache.h
src/kudu/util/coding.cc
+src/kudu/util/cache-test.cc
+src/kudu/util/cache.cc
src/kudu/util/coding.h
src/kudu/util/condition_variable.cc
src/kudu/util/condition_variable.h
src/kudu/util/env.cc
src/kudu/util/env.h
src/kudu/util/env_posix.cc
+src/kudu/util/nvm_cache.cc
src/kudu/util/random.h
src/kudu/util/slice.h
+src/kudu/util/status-test.cc
src/kudu/util/status.cc
src/kudu/util/status.h
+src/kudu/util/sync_point.cc
+src/kudu/util/sync_point.h
src/kudu/util/debug/trace_event.h
src/kudu/util/debug/trace_event_impl.cc
src/kudu/util/debug/trace_event_impl.h
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/server/default-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/default-path-handlers.cc b/src/kudu/server/default-path-handlers.cc
index 6053f4d..61134f1 100644
--- a/src/kudu/server/default-path-handlers.cc
+++ b/src/kudu/server/default-path-handlers.cc
@@ -14,18 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
#include "kudu/server/default-path-handlers.h"
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/server/default-path-handlers.h
----------------------------------------------------------------------
diff --git a/src/kudu/server/default-path-handlers.h b/src/kudu/server/default-path-handlers.h
index 0a2647b..818f068 100644
--- a/src/kudu/server/default-path-handlers.h
+++ b/src/kudu/server/default-path-handlers.h
@@ -14,18 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
#ifndef KUDU_SERVER_DEFAULT_PATH_HANDLERS_H
#define KUDU_SERVER_DEFAULT_PATH_HANDLERS_H
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/server/pprof-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/pprof-path-handlers.cc b/src/kudu/server/pprof-path-handlers.cc
index 52a045a..f9dac99 100644
--- a/src/kudu/server/pprof-path-handlers.cc
+++ b/src/kudu/server/pprof-path-handlers.cc
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#include "kudu/server/pprof-path-handlers.h"
#include <fstream>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/server/pprof-path-handlers.h
----------------------------------------------------------------------
diff --git a/src/kudu/server/pprof-path-handlers.h b/src/kudu/server/pprof-path-handlers.h
index 94f914b..e8c0329 100644
--- a/src/kudu/server/pprof-path-handlers.h
+++ b/src/kudu/server/pprof-path-handlers.h
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#ifndef KUDU_SERVER_PPROF_DEFAULT_PATH_HANDLERS_H
#define KUDU_SERVER_PPROF_DEFAULT_PATH_HANDLERS_H
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/server/webserver.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/webserver.cc b/src/kudu/server/webserver.cc
index 913f3b2..539bed5 100644
--- a/src/kudu/server/webserver.cc
+++ b/src/kudu/server/webserver.cc
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#include "kudu/server/webserver.h"
#include <algorithm>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/server/webserver.h
----------------------------------------------------------------------
diff --git a/src/kudu/server/webserver.h b/src/kudu/server/webserver.h
index a45261c..72ce092 100644
--- a/src/kudu/server/webserver.h
+++ b/src/kudu/server/webserver.h
@@ -14,18 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
#ifndef KUDU_UTIL_WEBSERVER_H
#define KUDU_UTIL_WEBSERVER_H
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/bit-stream-utils.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/bit-stream-utils.h b/src/kudu/util/bit-stream-utils.h
index 976bf80..06dc2a2 100644
--- a/src/kudu/util/bit-stream-utils.h
+++ b/src/kudu/util/bit-stream-utils.h
@@ -14,20 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
-
#ifndef IMPALA_UTIL_BIT_STREAM_UTILS_H
#define IMPALA_UTIL_BIT_STREAM_UTILS_H
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/bit-stream-utils.inline.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/bit-stream-utils.inline.h b/src/kudu/util/bit-stream-utils.inline.h
index bdccdb8..a06049e 100644
--- a/src/kudu/util/bit-stream-utils.inline.h
+++ b/src/kudu/util/bit-stream-utils.inline.h
@@ -14,20 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
-
#ifndef IMPALA_UTIL_BIT_STREAM_UTILS_INLINE_H
#define IMPALA_UTIL_BIT_STREAM_UTILS_INLINE_H
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/bit-util-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/bit-util-test.cc b/src/kudu/util/bit-util-test.cc
index 7b3e96d..02f5b7c 100644
--- a/src/kudu/util/bit-util-test.cc
+++ b/src/kudu/util/bit-util-test.cc
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#include <boost/utility.hpp>
#include <gtest/gtest.h>
#include "kudu/util/bit-util.h"
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/bit-util.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/bit-util.h b/src/kudu/util/bit-util.h
index da42f54..7f11f05 100644
--- a/src/kudu/util/bit-util.h
+++ b/src/kudu/util/bit-util.h
@@ -14,20 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
-
#ifndef IMPALA_BIT_UTIL_H
#define IMPALA_BIT_UTIL_H
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/cache-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/cache-test.cc b/src/kudu/util/cache-test.cc
index 1aec114..af99741 100644
--- a/src/kudu/util/cache-test.cc
+++ b/src/kudu/util/cache-test.cc
@@ -1,23 +1,6 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you 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, 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.
-//
// Some portions Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
+// found in the LICENSE file.
#include <glog/logging.h>
#include <gflags/gflags.h>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/cache.cc b/src/kudu/util/cache.cc
index c9d63ce..6b5f889 100644
--- a/src/kudu/util/cache.cc
+++ b/src/kudu/util/cache.cc
@@ -1,23 +1,6 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you 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, 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.
-//
// Some portions copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
+// found in the LICENSE file.
#include <glog/logging.h>
#include <memory>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/cache.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/cache.h b/src/kudu/util/cache.h
index da1c9cb..580d2ba 100644
--- a/src/kudu/util/cache.h
+++ b/src/kudu/util/cache.h
@@ -1,6 +1,6 @@
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
+// found in the LICENSE file.
//
// A Cache is an interface that maps keys to values. It has internal
// synchronization and may be safely accessed concurrently from
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/logging.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/logging.cc b/src/kudu/util/logging.cc
index cfe57f8..a5ff0cd 100644
--- a/src/kudu/util/logging.cc
+++ b/src/kudu/util/logging.cc
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#include "kudu/util/logging.h"
#include <boost/uuid/uuid.hpp>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/logging.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/logging.h b/src/kudu/util/logging.h
index 553e92a..c2858f8 100644
--- a/src/kudu/util/logging.h
+++ b/src/kudu/util/logging.h
@@ -14,18 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
#ifndef KUDU_UTIL_LOGGING_H
#define KUDU_UTIL_LOGGING_H
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/nvm_cache.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/nvm_cache.cc b/src/kudu/util/nvm_cache.cc
index cce82b9..9a169ff 100644
--- a/src/kudu/util/nvm_cache.cc
+++ b/src/kudu/util/nvm_cache.cc
@@ -1,23 +1,8 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you 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
+// This file is derived from cache.cc in the LevelDB project:
//
-// 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, 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.
-//
-// Some portions copyright (c) 2011 The LevelDB Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
+// Some portions copyright (c) 2011 The LevelDB Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
//
// ------------------------------------------------------------
// This file implements a cache based on the NVML library (http://pmem.io),
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/rle-encoding.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/rle-encoding.h b/src/kudu/util/rle-encoding.h
index 48626aa..120a159 100644
--- a/src/kudu/util/rle-encoding.h
+++ b/src/kudu/util/rle-encoding.h
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#ifndef IMPALA_RLE_ENCODING_H
#define IMPALA_RLE_ENCODING_H
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/rle-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/rle-test.cc b/src/kudu/util/rle-test.cc
index b220b30..d9a9489 100644
--- a/src/kudu/util/rle-test.cc
+++ b/src/kudu/util/rle-test.cc
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#include <stdlib.h>
#include <stdio.h>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/status-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/status-test.cc b/src/kudu/util/status-test.cc
index afbecd2..ca33b89 100644
--- a/src/kudu/util/status-test.cc
+++ b/src/kudu/util/status-test.cc
@@ -1,23 +1,6 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you 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, 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.
-//
// Some portions Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file. See the AUTHORS file for names of contributors.
+// found in the LICENSE file.
#include <glog/logging.h>
#include <gtest/gtest.h>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/sync_point.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/sync_point.cc b/src/kudu/util/sync_point.cc
index 7f171d7..ca9cef7 100644
--- a/src/kudu/util/sync_point.cc
+++ b/src/kudu/util/sync_point.cc
@@ -1,24 +1,7 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you 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, 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.
-//
// Copyright (c) 2014, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
-// LICENSE file in the root directory of this source tree. An additional grant
-// of patent rights can be found in the PATENTS file in the same directory.
+// LICENSE.txt file in the root directory of this source tree. An additional grant
+// of patent rights can be found in the same file.
#include "kudu/util/sync_point.h"
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/sync_point.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/sync_point.h b/src/kudu/util/sync_point.h
index b24686d..85a3c8c 100644
--- a/src/kudu/util/sync_point.h
+++ b/src/kudu/util/sync_point.h
@@ -1,24 +1,7 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you 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, 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.
-//
-// Copyright (c) 2014, Facebook, Inc. All rights reserved.
-// This source code is licensed under the BSD-style license found in the
-// LICENSE file in the root directory of this source tree. An additional grant
-// of patent rights can be found in the PATENTS file in the same directory.
+// Copyright (c) 2014, Facebook, Inc. All rights reserved.
+// This source code is licensed under the BSD-style license found in the
+// LICENSE.txt file in the root directory of this source tree. An additional grant
+// of patent rights can be found in the same file.
#pragma once
#include <string>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/url-coding-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/url-coding-test.cc b/src/kudu/util/url-coding-test.cc
index 37b81a4..1e06cce 100644
--- a/src/kudu/util/url-coding-test.cc
+++ b/src/kudu/util/url-coding-test.cc
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/51463bcf/src/kudu/util/url-coding.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/url-coding.h b/src/kudu/util/url-coding.h
index c2208a4..0a003b9 100644
--- a/src/kudu/util/url-coding.h
+++ b/src/kudu/util/url-coding.h
@@ -14,19 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-//
-// 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,
-// 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.
-
#ifndef UTIL_URL_CODING_H
#define UTIL_URL_CODING_H
[2/3] incubator-kudu git commit: Move OverwriteWithPattern to new
file optimized at -O3
Posted by to...@apache.org.
Move OverwriteWithPattern to new file optimized at -O3
This function ends up taking a fair amount of CPU in debug builds. We already
optimized it at -O3 for gcc, but clang doesn't support per-function
optimization. This commit just moves it to a new file and applies -O3 to that
file, so that clang builds also get an optimized implementation.
Hopefully this will improve flakiness of some tests that show up in ASAN/TSAN
builds due to very slow performance. This improved
'ts_recovery-itest --gtest_filter=\*969\*' from ~33s to ~25s on my laptop
in an ASAN build.
Change-Id: I1f18e6de3d5f5ab21b490ea4213c86b4d25706ba
Reviewed-on: http://gerrit.cloudera.org:8080/2478
Reviewed-by: Mike Percy <mp...@apache.org>
Tested-by: Kudu Jenkins
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/d24aa18d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/d24aa18d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/d24aa18d
Branch: refs/heads/master
Commit: d24aa18d634be50f11035630accaa0761cad7735
Parents: 51463bc
Author: Todd Lipcon <to...@apache.org>
Authored: Mon Mar 7 18:23:23 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue Mar 8 20:25:39 2016 +0000
----------------------------------------------------------------------
src/kudu/cfile/cfile_reader.cc | 1 +
src/kudu/common/columnblock.h | 2 +-
src/kudu/common/partial_row.cc | 1 +
src/kudu/common/predicate-test.cc | 1 +
src/kudu/common/rowblock.h | 2 +-
src/kudu/tablet/cbtree-test.cc | 1 +
src/kudu/tablet/memrowset.cc | 1 +
src/kudu/util/CMakeLists.txt | 9 ++++++-
src/kudu/util/memory/memory.cc | 30 +++--------------------
src/kudu/util/memory/memory.h | 4 +--
src/kudu/util/memory/overwrite.cc | 45 ++++++++++++++++++++++++++++++++++
src/kudu/util/memory/overwrite.h | 27 ++++++++++++++++++++
12 files changed, 91 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/cfile/cfile_reader.cc
----------------------------------------------------------------------
diff --git a/src/kudu/cfile/cfile_reader.cc b/src/kudu/cfile/cfile_reader.cc
index f2d8597..03689c5 100644
--- a/src/kudu/cfile/cfile_reader.cc
+++ b/src/kudu/cfile/cfile_reader.cc
@@ -37,6 +37,7 @@
#include "kudu/util/debug/trace_event.h"
#include "kudu/util/flag_tags.h"
#include "kudu/util/malloc.h"
+#include "kudu/util/memory/overwrite.h"
#include "kudu/util/object_pool.h"
#include "kudu/util/rle-encoding.h"
#include "kudu/util/slice.h"
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/common/columnblock.h
----------------------------------------------------------------------
diff --git a/src/kudu/common/columnblock.h b/src/kudu/common/columnblock.h
index d6cf44d..6fae578 100644
--- a/src/kudu/common/columnblock.h
+++ b/src/kudu/common/columnblock.h
@@ -22,11 +22,11 @@
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/util/bitmap.h"
#include "kudu/util/memory/arena.h"
+#include "kudu/util/memory/overwrite.h"
#include "kudu/util/status.h"
namespace kudu {
-class Arena;
class ColumnBlockCell;
// A block of data all belonging to a single column.
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/common/partial_row.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/partial_row.cc b/src/kudu/common/partial_row.cc
index 7f6bff9..1ff6a54 100644
--- a/src/kudu/common/partial_row.cc
+++ b/src/kudu/common/partial_row.cc
@@ -27,6 +27,7 @@
#include "kudu/common/wire_protocol.pb.h"
#include "kudu/gutil/strings/substitute.h"
#include "kudu/util/bitmap.h"
+#include "kudu/util/memory/overwrite.h"
#include "kudu/util/status.h"
using strings::Substitute;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/common/predicate-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/common/predicate-test.cc b/src/kudu/common/predicate-test.cc
index a7c83f8..e1db67b 100644
--- a/src/kudu/common/predicate-test.cc
+++ b/src/kudu/common/predicate-test.cc
@@ -19,6 +19,7 @@
#include "kudu/common/scan_predicate.h"
#include "kudu/common/rowblock.h"
+#include "kudu/util/memory/overwrite.h"
#include "kudu/util/test_util.h"
namespace kudu {
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/common/rowblock.h
----------------------------------------------------------------------
diff --git a/src/kudu/common/rowblock.h b/src/kudu/common/rowblock.h
index 672849c..c627ad9 100644
--- a/src/kudu/common/rowblock.h
+++ b/src/kudu/common/rowblock.h
@@ -23,11 +23,11 @@
#include "kudu/common/row.h"
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/gutil/macros.h"
-#include "kudu/util/memory/arena.h"
#include "kudu/util/bitmap.h"
namespace kudu {
+class Arena;
class RowBlockRow;
// Bit-vector representing the selection status of each row in a row block.
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/tablet/cbtree-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/cbtree-test.cc b/src/kudu/tablet/cbtree-test.cc
index 0f42e1b..58346c3 100644
--- a/src/kudu/tablet/cbtree-test.cc
+++ b/src/kudu/tablet/cbtree-test.cc
@@ -26,6 +26,7 @@
#include "kudu/tablet/concurrent_btree.h"
#include "kudu/util/hexdump.h"
#include "kudu/util/memory/memory.h"
+#include "kudu/util/memory/overwrite.h"
#include "kudu/util/stopwatch.h"
#include "kudu/util/test_macros.h"
#include "kudu/util/test_util.h"
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/tablet/memrowset.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/memrowset.cc b/src/kudu/tablet/memrowset.cc
index 05b1786..5b18196 100644
--- a/src/kudu/tablet/memrowset.cc
+++ b/src/kudu/tablet/memrowset.cc
@@ -33,6 +33,7 @@
#include "kudu/tablet/compaction.h"
#include "kudu/util/flag_tags.h"
#include "kudu/util/mem_tracker.h"
+#include "kudu/util/memory/overwrite.h"
DEFINE_bool(mrs_use_codegen, true, "whether the memrowset should use code "
"generation for iteration");
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/util/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/util/CMakeLists.txt b/src/kudu/util/CMakeLists.txt
index 23ac5e5..db94115 100644
--- a/src/kudu/util/CMakeLists.txt
+++ b/src/kudu/util/CMakeLists.txt
@@ -120,7 +120,9 @@ set(UTIL_SRCS
logging.cc
malloc.cc
memcmpable_varint.cc
- memory/arena.cc memory/memory.cc
+ memory/arena.cc
+ memory/memory.cc
+ memory/overwrite.cc
memenv/memenv.cc
mem_tracker.cc
metrics.cc
@@ -160,6 +162,11 @@ set(UTIL_SRCS
version_info.cc
)
+# overwrite.cc contains a single function which would be a hot spot in
+# debug builds. It's separated into a separate file so it can be
+# optimized regardless of the default optimization options.
+set_source_files_properties(memory/overwrite.cc PROPERTIES COMPILE_FLAGS "-O3")
+
if(NOT APPLE)
set(UTIL_SRCS
${UTIL_SRCS}
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/util/memory/memory.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memory/memory.cc b/src/kudu/util/memory/memory.cc
index 02065af..835ad3e 100644
--- a/src/kudu/util/memory/memory.cc
+++ b/src/kudu/util/memory/memory.cc
@@ -18,9 +18,11 @@
// under the License.
//
+#include "kudu/util/memory/memory.h"
+
#include "kudu/util/alignment.h"
#include "kudu/util/flag_tags.h"
-#include "kudu/util/memory/memory.h"
+#include "kudu/util/memory/overwrite.h"
#include "kudu/util/mem_tracker.h"
#include <gflags/gflags.h>
@@ -42,32 +44,6 @@ namespace {
static char dummy_buffer[0] = {};
}
-// This function is micro-optimized a bit, since it helps debug
-// mode tests run much faster.
-#if defined(__GNUC__) && !defined(__clang__)
-#pragma GCC push_options
-#pragma GCC optimize("-O3")
-#endif
-void OverwriteWithPattern(char* p, size_t len, StringPiece pattern) {
- size_t pat_len = pattern.size();
- CHECK_LT(0, pat_len);
- size_t rem = len;
- const char *pat_ptr = pattern.data();
-
- while (rem >= pat_len) {
- memcpy(p, pat_ptr, pat_len);
- p += pat_len;
- rem -= pat_len;
- }
-
- while (rem-- > 0) {
- *p++ = *pat_ptr++;
- }
-}
-#if defined(__GNUC__) && !defined(__clang__)
-#pragma GCC pop_options
-#endif
-
Buffer::~Buffer() {
#if !defined(NDEBUG) && !defined(ADDRESS_SANITIZER)
// "unrolling" the string "BAD" makes for a much more efficient
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/util/memory/memory.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/memory/memory.h b/src/kudu/util/memory/memory.h
index f618ea8..eabc142 100644
--- a/src/kudu/util/memory/memory.h
+++ b/src/kudu/util/memory/memory.h
@@ -40,11 +40,11 @@
#include <vector>
#include "kudu/util/boost_mutex_utils.h"
+#include "kudu/util/memory/overwrite.h"
#include "kudu/util/mutex.h"
#include "kudu/gutil/gscoped_ptr.h"
#include "kudu/gutil/logging-inl.h"
#include "kudu/gutil/macros.h"
-#include "kudu/gutil/strings/stringpiece.h"
#include "kudu/gutil/singleton.h"
using std::copy;
@@ -61,8 +61,6 @@ namespace kudu {
class BufferAllocator;
class MemTracker;
-void OverwriteWithPattern(char* p, size_t len, StringPiece pattern);
-
// Wrapper for a block of data allocated by a BufferAllocator. Owns the block.
// (To release the block, destroy the buffer - it will then return it via the
// same allocator that has been used to create it).
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/util/memory/overwrite.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/memory/overwrite.cc b/src/kudu/util/memory/overwrite.cc
new file mode 100644
index 0000000..9680c0d
--- /dev/null
+++ b/src/kudu/util/memory/overwrite.cc
@@ -0,0 +1,45 @@
+// Copyright 2010 Google Inc. All Rights Reserved
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you 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, 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.
+
+#include "kudu/util/memory/overwrite.h"
+
+#include "kudu/gutil/strings/stringpiece.h"
+
+#include <string.h>
+#include <glog/logging.h>
+namespace kudu {
+
+void OverwriteWithPattern(char* p, size_t len, StringPiece pattern) {
+ size_t pat_len = pattern.size();
+ CHECK_LT(0, pat_len);
+ size_t rem = len;
+ const char *pat_ptr = pattern.data();
+
+ while (rem >= pat_len) {
+ memcpy(p, pat_ptr, pat_len);
+ p += pat_len;
+ rem -= pat_len;
+ }
+
+ while (rem-- > 0) {
+ *p++ = *pat_ptr++;
+ }
+}
+
+} // namespace kudu
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/d24aa18d/src/kudu/util/memory/overwrite.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/memory/overwrite.h b/src/kudu/util/memory/overwrite.h
new file mode 100644
index 0000000..6db4db5
--- /dev/null
+++ b/src/kudu/util/memory/overwrite.h
@@ -0,0 +1,27 @@
+// Copyright (c) 2015, Cloudera, 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,
+// 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.
+#ifndef KUDU_MEMORY_OVERWRITE_H
+#define KUDU_MEMORY_OVERWRITE_H
+
+#include "kudu/gutil/strings/stringpiece.h"
+
+namespace kudu {
+
+// Overwrite 'p' with enough repetitions of 'pattern' to fill 'len'
+// bytes. This is optimized at -O3 even in debug builds, so is
+// reasonably efficient to use.
+void OverwriteWithPattern(char* p, size_t len, StringPiece pattern);
+
+} // namespace kudu
+#endif /* KUDU_MEMORY_OVERWRITE_H */
+
[3/3] incubator-kudu git commit: client_failover-itest: fix flakiness
with opid mismatches
Posted by to...@apache.org.
client_failover-itest: fix flakiness with opid mismatches
This fixes a common source of flakiness, particular in TSAN builds. The issue
was that we were assuming that, if the TestWorkload wrote N batches, that would
correspond exactly to N log operations on the server side. That actually isn't
the case -- there are some interleavings in which the client 'Batcher' can
split a single Flush call into multiple RPCs, and we don't make any strong
guarantees that a Flush is atomic, even though it is almost all the time.
The fix is simple: switch to single-row batches, which can't be split up
into the client.
On an earlier revision of this patch, I was able to run the
DeleteLeaderWhileScanning tests 5000 times in TSAN with only a few failures[1].
I ran 1000 on the latest revision[2]. The remaining failures seem to be an
unrelated data race on RaftConsensus shutdown.
[1] http://dist-test.cloudera.org/job?job_id=todd.1457413245.29963
[2] http://dist-test.cloudera.org/job?job_id=todd.1457464975.21171
Change-Id: Ib3df1b3f5b0903f069a5e7ae3ba2a64c1c52a427
Reviewed-on: http://gerrit.cloudera.org:8080/2479
Reviewed-by: Mike Percy <mp...@apache.org>
Tested-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/ebb37133
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/ebb37133
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/ebb37133
Branch: refs/heads/master
Commit: ebb371335c3ccc481d2e6f16da8b1193bb2c7af0
Parents: d24aa18
Author: Todd Lipcon <to...@apache.org>
Authored: Mon Mar 7 19:10:59 2016 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue Mar 8 20:26:30 2016 +0000
----------------------------------------------------------------------
src/kudu/integration-tests/client_failover-itest.cc | 7 +++++++
src/kudu/integration-tests/test_workload.h | 3 +++
2 files changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/ebb37133/src/kudu/integration-tests/client_failover-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/client_failover-itest.cc b/src/kudu/integration-tests/client_failover-itest.cc
index eb57fcc..de32b5f 100644
--- a/src/kudu/integration-tests/client_failover-itest.cc
+++ b/src/kudu/integration-tests/client_failover-itest.cc
@@ -69,6 +69,12 @@ TEST_P(ClientFailoverParamITest, TestDeleteLeaderWhileScanning) {
// Create the test table.
TestWorkload workload(cluster_.get());
workload.set_write_timeout_millis(kTimeout.ToMilliseconds());
+ // We count on each flush from the client corresponding to exactly one
+ // consensus operation in this test. If we use batches with more than one row,
+ // the client is allowed to (and will on rare occasion) break the batches
+ // up into more than one write request, resulting in more than one op
+ // in the log.
+ workload.set_write_batch_size(1);
workload.Setup();
// Figure out the tablet id.
@@ -120,6 +126,7 @@ TEST_P(ClientFailoverParamITest, TestDeleteLeaderWhileScanning) {
SleepFor(MonoDelta::FromMilliseconds(10));
}
workload.StopAndJoin();
+ LOG(INFO) << "workload completed " << workload.batches_completed() << " batches";
// We don't want the leader that takes over after we kill the first leader to
// be unsure whether the writes have been committed, so wait until all
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/ebb37133/src/kudu/integration-tests/test_workload.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/test_workload.h b/src/kudu/integration-tests/test_workload.h
index 4d106ed..307ae92 100644
--- a/src/kudu/integration-tests/test_workload.h
+++ b/src/kudu/integration-tests/test_workload.h
@@ -119,6 +119,9 @@ class TestWorkload {
// Return the number of batches in which we have successfully inserted at
// least one row.
+ // NOTE: it is not safe to assume that this is exactly equal to the number
+ // of log operations generated on the TS side. The client may split a single
+ // Flush() call into multiple batches.
int64_t batches_completed() const {
return batches_completed_.Load();
}