[01/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
Repository: incubator-quickstep
Updated Branches:
  refs/heads/master 8a84039e1 -> c43107d1f


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/windows/raw_logging.cc
--
diff --git a/third_party/src/glog/src/windows/raw_logging.cc 
b/third_party/src/glog/src/windows/raw_logging.cc
deleted file mode 100644
index 7a7409b..000
--- a/third_party/src/glog/src/windows/raw_logging.cc
+++ /dev/null
@@ -1,172 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Maxim Lifantsev
-//
-// logging_unittest.cc covers the functionality herein
-
-#include "utilities.h"
-
-#include 
-#include 
-#include 
-#ifdef HAVE_UNISTD_H
-# include// for close() and write()
-#endif
-#include  // for open()
-#include 
-#include "config.h"
-#include "glog/logging.h"  // To pick up flag settings etc.
-#include "glog/raw_logging.h"
-#include "base/commandlineflags.h"
-
-#ifdef HAVE_STACKTRACE
-# include "stacktrace.h"
-#endif
-
-#if defined(HAVE_SYSCALL_H)
-#include  // for syscall()
-#elif defined(HAVE_SYS_SYSCALL_H)
-#include  // for syscall()
-#endif
-#ifdef HAVE_UNISTD_H
-# include 
-#endif
-
-#if defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)
-# define safe_write(fd, s, len)  syscall(SYS_write, fd, s, len)
-#else
-  // Not so safe, but what can you do?
-# define safe_write(fd, s, len)  write(fd, s, len)
-#endif
-
-_START_GOOGLE_NAMESPACE_
-
-// Data for RawLog__ below. We simply pick up the latest
-// time data created by a normal log message to avoid calling
-// localtime_r which can allocate memory.
-static struct ::tm last_tm_time_for_raw_log;
-static int last_usecs_for_raw_log;
-
-void RawLog__SetLastTime(const struct ::tm& t, int usecs) {
-  memcpy(&last_tm_time_for_raw_log, &t, sizeof(last_tm_time_for_raw_log));
-  last_usecs_for_raw_log = usecs;
-}
-
-// CAVEAT: vsnprintf called from *DoRawLog below has some (exotic) code paths
-// that invoke malloc() and getenv() that might acquire some locks.
-// If this becomes a problem we should reimplement a subset of vsnprintf
-// that does not need locks and malloc.
-
-// Helper for RawLog__ below.
-// *DoRawLog writes to *buf of *size and move them past the written portion.
-// It returns true iff there was no overflow or error.
-static bool DoRawLog(char** buf, int* size, const char* format, ...) {
-  va_list ap;
-  va_start(ap, format);
-  int n = vsnprintf(*buf, *size, format, ap);
-  va_end(ap);
-  if (n < 0 || n > *size) return false;
-  *size -= n;
-  *buf += n;
-  return true;
-}
-
-// Helper for RawLog__ below.
-inline static bool VADoRawLog(char** buf, int* size,
-  const char* format, va_list ap) {
-  int n = vsnprintf(*buf, *size, format, ap);
-  if (n < 0 || n > *size) return false;
-  *size -= n;
-  *buf += n;
-  return true;
-}
-
-static const int kLogBufSize = 3000;
-static bool crashed = false;
-static CrashReason crash_reason;
-static char crash_buf[kLogBufSize + 1] = { 0 };  // Will end in '\0'
-
-void RawLog__(LogSeverity severity, const char* file, int line,
-  const char* format, ...) {
-  if (!(FLAGS_logtostderr || severity >= FLAGS_stderrthreshold ||
-FLAGS_alsologtostderr || !IsGoogleLoggingInitialized())) {
-return;  // this stderr log message is suppressed
-  }
-  // can't call loca

[06/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/logging_unittest.cc
--
diff --git a/third_party/src/glog/src/logging_unittest.cc 
b/third_party/src/glog/src/logging_unittest.cc
deleted file mode 100644
index d7e95cf..000
--- a/third_party/src/glog/src/logging_unittest.cc
+++ /dev/null
@@ -1,1215 +0,0 @@
-// Copyright (c) 2002, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Ray Sidney
-
-#include "config_for_unittests.h"
-#include "utilities.h"
-
-#include 
-#ifdef HAVE_GLOB_H
-# include 
-#endif
-#include 
-#ifdef HAVE_UNISTD_H
-# include 
-#endif
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-
-#include "base/commandlineflags.h"
-#include "glog/logging.h"
-#include "glog/raw_logging.h"
-#include "googletest.h"
-
-DECLARE_string(log_backtrace_at);  // logging.cc
-
-#ifdef HAVE_LIB_GFLAGS
-#include 
-#endif
-
-#ifdef HAVE_LIB_GMOCK
-#include 
-#include "mock-log.h"
-// Introduce several symbols from gmock.
-using testing::_;
-using testing::AnyNumber;
-using testing::HasSubstr;
-using testing::AllOf;
-using testing::StrNe;
-using testing::StrictMock;
-using testing::InitGoogleMock;
-using GOOGLE_NAMESPACE::glog_testing::ScopedMockLog;
-#endif
-
-using namespace std;
-using namespace GOOGLE_NAMESPACE;
-
-// Some non-advertised functions that we want to test or use.
-_START_GOOGLE_NAMESPACE_
-namespace base {
-namespace internal {
-bool GetExitOnDFatal();
-void SetExitOnDFatal(bool value);
-}  // namespace internal
-}  // namespace base
-_END_GOOGLE_NAMESPACE_
-
-static void TestLogging(bool check_counts);
-static void TestRawLogging();
-static void LogWithLevels(int v, int severity, bool err, bool alsoerr);
-static void TestLoggingLevels();
-static void TestLogString();
-static void TestLogSink();
-static void TestLogToString();
-static void TestLogSinkWaitTillSent();
-static void TestCHECK();
-static void TestDCHECK();
-static void TestSTREQ();
-static void TestBasename();
-static void TestSymlink();
-static void TestExtension();
-static void TestWrapper();
-static void TestErrno();
-static void TestTruncate();
-
-static int x = -1;
-static void BM_Check1(int n) {
-  while (n-- > 0) {
-CHECK_GE(n, x);
-CHECK_GE(n, x);
-CHECK_GE(n, x);
-CHECK_GE(n, x);
-CHECK_GE(n, x);
-CHECK_GE(n, x);
-CHECK_GE(n, x);
-CHECK_GE(n, x);
-  }
-}
-BENCHMARK(BM_Check1);
-
-static void CheckFailure(int a, int b, const char* file, int line, const char* 
msg);
-static void BM_Check3(int n) {
-  while (n-- > 0) {
-if (n < x) CheckFailure(n, x, __FILE__, __LINE__, "n < x");
-if (n < x) CheckFailure(n, x, __FILE__, __LINE__, "n < x");
-if (n < x) CheckFailure(n, x, __FILE__, __LINE__, "n < x");
-if (n < x) CheckFailure(n, x, __FILE__, __LINE__, "n < x");
-if (n < x) CheckFailure(n, x, __FILE__, __LINE__, "n < x");
-if (n < x) CheckFailure(n, x, __FILE__, __LINE__, "n < x");
-if (n < x) CheckFailure(n, x, __FILE__, __LINE__, "n < x");
-if (n < x) CheckFailure(n, x, __FILE__, __LINE__, "n < x");
-  }
-}
-BENCHMARK(BM_Check3);
-
-static void BM_Check2(int n) {
-  if (n == 17) {
-x = 5;
-  }
-  while (n-- > 0) {
-CHECK(n >= x);
-CHECK(n >= x);
-CHECK(n >= x);
-CHECK(n >= x);
-CHECK(n >= x);
-CHECK(n >= x);
-CHECK(n >= x);
-CHECK(n >= x);
-  }
-}
-BENCHMARK(BM_Ch

[08/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/glog/vlog_is_on.h
--
diff --git a/third_party/src/glog/src/glog/vlog_is_on.h 
b/third_party/src/glog/src/glog/vlog_is_on.h
deleted file mode 100644
index 02b0b86..000
--- a/third_party/src/glog/src/glog/vlog_is_on.h
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 1999, 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Ray Sidney and many others
-//
-// Defines the VLOG_IS_ON macro that controls the variable-verbosity
-// conditional logging.
-//
-// It's used by VLOG and VLOG_IF in logging.h
-// and by RAW_VLOG in raw_logging.h to trigger the logging.
-//
-// It can also be used directly e.g. like this:
-//   if (VLOG_IS_ON(2)) {
-// // do some logging preparation and logging
-// // that can't be accomplished e.g. via just VLOG(2) << ...;
-//   }
-//
-// The truth value that VLOG_IS_ON(level) returns is determined by 
-// the three verbosity level flags:
-//   --v=  Gives the default maximal active V-logging level;
-//0 is the default.
-//Normally positive values are used for V-logging levels.
-//   --vmodule=  Gives the per-module maximal V-logging levels to override
-//the value given by --v.
-//E.g. "my_module=2,foo*=3" would change the logging level
-//for all code in source files "my_module.*" and "foo*.*"
-//("-inl" suffixes are also disregarded for this matching).
-//
-// SetVLOGLevel helper function is provided to do limited dynamic control over
-// V-logging by overriding the per-module settings given via --vmodule flag.
-//
-// CAVEAT: --vmodule functionality is not available in non gcc compilers.
-//
-
-#ifndef BASE_VLOG_IS_ON_H_
-#define BASE_VLOG_IS_ON_H_
-
-#include "glog/log_severity.h"
-
-// Annoying stuff for windows -- makes sure clients can import these functions
-#ifndef GOOGLE_GLOG_DLL_DECL
-# if defined(_WIN32) && !defined(__CYGWIN__)
-#   define GOOGLE_GLOG_DLL_DECL  __declspec(dllimport)
-# else
-#   define GOOGLE_GLOG_DLL_DECL
-# endif
-#endif
-
-#if defined(__GNUC__)
-// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site.
-// (Normally) the first time every VLOG_IS_ON(n) site is hit,
-// we determine what variable will dynamically control logging at this site:
-// it's either FLAGS_v or an appropriate internal variable
-// matching the current source file that represents results of
-// parsing of --vmodule flag and/or SetVLOGLevel calls.
-#define VLOG_IS_ON(verboselevel)\
-  __extension__  \
-  ({ static google::int32* vlocal__ = &google::kLogSiteUninitialized;  
 \
- google::int32 verbose_level__ = (verboselevel);\
- (*vlocal__ >= verbose_level__) &&  \
- ((vlocal__ != &google::kLogSiteUninitialized) ||   \
-  (google::InitVLOG3__(&vlocal__, &FLAGS_v, \
-   __FILE__, verbose_level__))); })
-#else
-// GNU extensions not available, so we do not support --vmodule.
-// Dynamic value of FLAGS_v always controls the logging level.
-#define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel))
-#endif
-
-// Set VLOG(_IS_ON) level for module_pattern to log_level.
-// This lets us dynamically control what is normally set by the --vmod

[10/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/base/mutex.h
--
diff --git a/third_party/src/glog/src/base/mutex.h 
b/third_party/src/glog/src/base/mutex.h
deleted file mode 100644
index 37527d5..000
--- a/third_party/src/glog/src/base/mutex.h
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-// 
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-// 
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-// 
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// 
-// ---
-// Author: Craig Silverstein.
-//
-// A simple mutex wrapper, supporting locks and read-write locks.
-// You should assume the locks are *not* re-entrant.
-//
-// To use: you should define the following macros in your configure.ac:
-//   ACX_PTHREAD
-//   AC_RWLOCK
-// The latter is defined in ../autoconf.
-//
-// This class is meant to be internal-only and should be wrapped by an
-// internal namespace.  Before you use this module, please give the
-// name of your internal namespace for this module.  Or, if you want
-// to expose it, you'll want to move it to the Google namespace.  We
-// cannot put this class in global namespace because there can be some
-// problems when we have multiple versions of Mutex in each shared object.
-//
-// NOTE: by default, we have #ifdef'ed out the TryLock() method.
-//   This is for two reasons:
-// 1) TryLock() under Windows is a bit annoying (it requires a
-//#define to be defined very early).
-// 2) TryLock() is broken for NO_THREADS mode, at least in NDEBUG
-//mode.
-// If you need TryLock(), and either these two caveats are not a
-// problem for you, or you're willing to work around them, then
-// feel free to #define GMUTEX_TRYLOCK, or to remove the #ifdefs
-// in the code below.
-//
-// CYGWIN NOTE: Cygwin support for rwlock seems to be buggy:
-//http://www.cygwin.com/ml/cygwin/2008-12/msg00017.html
-// Because of that, we might as well use windows locks for
-// cygwin.  They seem to be more reliable than the cygwin pthreads layer.
-//
-// TRICKY IMPLEMENTATION NOTE:
-// This class is designed to be safe to use during
-// dynamic-initialization -- that is, by global constructors that are
-// run before main() starts.  The issue in this case is that
-// dynamic-initialization happens in an unpredictable order, and it
-// could be that someone else's dynamic initializer could call a
-// function that tries to acquire this mutex -- but that all happens
-// before this mutex's constructor has run.  (This can happen even if
-// the mutex and the function that uses the mutex are in the same .cc
-// file.)  Basically, because Mutex does non-trivial work in its
-// constructor, it's not, in the naive implementation, safe to use
-// before dynamic initialization has run on it.
-//
-// The solution used here is to pair the actual mutex primitive with a
-// bool that is set to true when the mutex is dynamically initialized.
-// (Before that it's false.)  Then we modify all mutex routines to
-// look at the bool, and not try to lock/unlock until the bool makes
-// it to true (which happens after the Mutex constructor has run.)
-//
-// This works because before main() starts -- particularly, during
-// dynamic initialization -- there are no threads, so a) it's ok that
-// the mutex operations are a no-op, since we don't need locking then
-// anyway; and b) we can be quite confident our bool won't change
-// state between a call to Lock() and a call to Unlock() (that would
-// require a global const

[07/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/logging.cc
--
diff --git a/third_party/src/glog/src/logging.cc 
b/third_party/src/glog/src/logging.cc
deleted file mode 100644
index ec334a9..000
--- a/third_party/src/glog/src/logging.cc
+++ /dev/null
@@ -1,2049 +0,0 @@
-// Copyright (c) 1999, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#define _GNU_SOURCE 1 // needed for O_NOFOLLOW and pread()/pwrite()
-
-#include "utilities.h"
-
-#include 
-#include 
-#include 
-#ifdef HAVE_UNISTD_H
-# include   // For _exit.
-#endif
-#include 
-#include 
-#include 
-#ifdef HAVE_SYS_UTSNAME_H
-# include   // For uname.
-#endif
-#include 
-#include 
-#include 
-#include 
-#include 
-#ifdef HAVE_PWD_H
-# include 
-#endif
-#ifdef HAVE_SYSLOG_H
-# include 
-#endif
-#include 
-#include// for errno
-#include 
-#include "base/commandlineflags.h"// to get the program name
-#include "glog/logging.h"
-#include "glog/raw_logging.h"
-#include "base/googleinit.h"
-
-#ifdef HAVE_STACKTRACE
-# include "stacktrace.h"
-#endif
-
-using std::string;
-using std::vector;
-using std::setw;
-using std::setfill;
-using std::hex;
-using std::dec;
-using std::min;
-using std::ostream;
-using std::ostringstream;
-
-using std::FILE;
-using std::fwrite;
-using std::fclose;
-using std::fflush;
-using std::fprintf;
-using std::perror;
-
-#ifdef __QNX__
-using std::fdopen;
-#endif
-
-// There is no thread annotation support.
-#define EXCLUSIVE_LOCKS_REQUIRED(mu)
-
-static bool BoolFromEnv(const char *varname, bool defval) {
-  const char* const valstr = getenv(varname);
-  if (!valstr) {
-return defval;
-  }
-  return memchr("tTyY1\0", valstr[0], 6) != NULL;
-}
-
-GLOG_DEFINE_bool(logtostderr, BoolFromEnv("GOOGLE_LOGTOSTDERR", false),
- "log messages go to stderr instead of logfiles");
-GLOG_DEFINE_bool(alsologtostderr, BoolFromEnv("GOOGLE_ALSOLOGTOSTDERR", false),
- "log messages go to stderr in addition to logfiles");
-GLOG_DEFINE_bool(colorlogtostderr, false,
- "color messages logged to stderr (if supported by terminal)");
-#ifdef OS_LINUX
-GLOG_DEFINE_bool(drop_log_memory, true, "Drop in-memory buffers of log 
contents. "
- "Logs can grow very quickly and they are rarely read before 
they "
- "need to be evicted from memory. Instead, drop them from 
memory "
- "as soon as they are flushed to disk.");
-_START_GOOGLE_NAMESPACE_
-namespace logging {
-static const int64 kPageSize = getpagesize();
-}
-_END_GOOGLE_NAMESPACE_
-#endif
-
-// By default, errors (including fatal errors) get logged to stderr as
-// well as the file.
-//
-// The default is ERROR instead of FATAL so that users can see problems
-// when they run a program without having to look in another file.
-DEFINE_int32(stderrthreshold,
- GOOGLE_NAMESPACE::GLOG_ERROR,
- "log messages at or above this level are copied to stderr in "
- "addition to logfiles.  This flag obsoletes --alsologtostderr.");
-
-GLOG_DEFINE_string(alsologtoemail, "",
-   "log messages go to these email addresses "
-   "in addition to logfiles");
-GLOG_DEFINE_bool(log_prefix, true,
- "Prepend the log prefix to the start of each log line");
-GLOG_DEFINE_int32(minloglevel, 0, "Messages logged at a lower

[03/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/windows/glog/logging.h
--
diff --git a/third_party/src/glog/src/windows/glog/logging.h 
b/third_party/src/glog/src/windows/glog/logging.h
deleted file mode 100644
index 1d91b12..000
--- a/third_party/src/glog/src/windows/glog/logging.h
+++ /dev/null
@@ -1,1603 +0,0 @@
-// This file is automatically generated from src/glog/logging.h.in
-// using src/windows/preprocess.sh.
-// DO NOT EDIT!
-
-// Copyright (c) 1999, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Ray Sidney
-//
-// This file contains #include information about logging-related stuff.
-// Pretty much everybody needs to #include this file so that they can
-// log various happenings.
-//
-#ifndef _LOGGING_H_
-#define _LOGGING_H_
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#if 0
-# include 
-#endif
-#include 
-
-// Annoying stuff for windows -- makes sure clients can import these functions
-#ifndef GOOGLE_GLOG_DLL_DECL
-# if defined(_WIN32) && !defined(__CYGWIN__)
-#   define GOOGLE_GLOG_DLL_DECL  __declspec(dllimport)
-# else
-#   define GOOGLE_GLOG_DLL_DECL
-# endif
-#endif
-#if defined(_MSC_VER)
-#define GLOG_MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \
- __pragma(warning(disable:n))
-#define GLOG_MSVC_POP_WARNING() __pragma(warning(pop))
-#else
-#define GLOG_MSVC_PUSH_DISABLE_WARNING(n)
-#define GLOG_MSVC_POP_WARNING()
-#endif
-
-// We care a lot about number of bits things take up.  Unfortunately,
-// systems define their bit-specific ints in a lot of different ways.
-// We use our own way, and have a typedef to get there.
-// Note: these commands below may look like "#if 1" or "#if 0", but
-// that's because they were constructed that way at ./configure time.
-// Look at logging.h.in to see how they're calculated (based on your config).
-#if 0
-#include  // the normal place uint16_t is defined
-#endif
-#if 0
-#include   // the normal place u_int16_t is defined
-#endif
-#if 0
-#include// a third place for uint16_t or u_int16_t
-#endif
-
-#if 0
-#include 
-#endif
-
-namespace google {
-
-#if 0  // the C99 format
-typedef int32_t int32;
-typedef uint32_t uint32;
-typedef int64_t int64;
-typedef uint64_t uint64;
-#elif 0   // the BSD format
-typedef int32_t int32;
-typedef u_int32_t uint32;
-typedef int64_t int64;
-typedef u_int64_t uint64;
-#elif 1// the windows (vc7) format
-typedef __int32 int32;
-typedef unsigned __int32 uint32;
-typedef __int64 int64;
-typedef unsigned __int64 uint64;
-#else
-#error Do not know how to define a 32-bit integer quantity on your system
-#endif
-
-}
-
-// The global value of GOOGLE_STRIP_LOG. All the messages logged to
-// LOG(XXX) with severity less than GOOGLE_STRIP_LOG will not be displayed.
-// If it can be determined at compile time that the message will not be
-// printed, the statement will be compiled out.
-//
-// Example: to strip out all INFO and WARNING messages, use the value
-// of 2 below. To make an exception for WARNING messages from a single
-// file, add "#define GOOGLE_STRIP_LOG 1" to that file _before_ including
-// base/logging.h
-#ifndef GOOGLE_STRIP_LOG
-#define GOOGLE_STRIP_LOG 0
-#endif
-
-// GCC can be told that a certain branch is not likely to be taken (for
-// instance, a CHECK failure), and use

[11/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
Remove glog source code from third party

- glog source code is now downloaded through the download script.
- Added patches for glog.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/c43107d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/c43107d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/c43107d1

Branch: refs/heads/master
Commit: c43107d1fed5f96770024d52c10cd7bd061bb7c1
Parents: 8a84039
Author: Harshad Deshmukh 
Authored: Fri Dec 15 15:06:49 2017 -0600
Committer: Harshad Deshmukh 
Committed: Sat Dec 16 18:53:45 2017 -0600

--
 CMakeLists.txt  |3 +-
 third_party/download_and_patch_prerequisites.sh |8 +
 .../patches/glog/glogCMakeLists.txt.patch   |   23 +
 third_party/patches/glog/utilities.cc.patch |   11 +
 third_party/reset_third_party_dir.sh|1 +
 third_party/src/glog/AUTHORS|2 -
 third_party/src/glog/CMakeLists.txt |  208 --
 third_party/src/glog/COPYING|   65 -
 third_party/src/glog/ChangeLog  |   84 -
 third_party/src/glog/INSTALL|  297 ---
 third_party/src/glog/NEWS   |0
 third_party/src/glog/README |5 -
 third_party/src/glog/README.windows |   26 -
 third_party/src/glog/doc/designstyle.css|  115 -
 third_party/src/glog/doc/glog.html  |  613 --
 .../src/glog/src/base/commandlineflags.h|  133 --
 third_party/src/glog/src/base/googleinit.h  |   51 -
 third_party/src/glog/src/base/mutex.h   |  331 ---
 third_party/src/glog/src/config.h.in|  171 --
 third_party/src/glog/src/config_cmake.h.in  |  169 --
 third_party/src/glog/src/config_for_unittests.h |   66 -
 third_party/src/glog/src/demangle.cc| 1304 ---
 third_party/src/glog/src/demangle.h |   84 -
 third_party/src/glog/src/demangle_unittest.cc   |  142 --
 third_party/src/glog/src/demangle_unittest.sh   |   95 -
 third_party/src/glog/src/demangle_unittest.txt  |  137 --
 third_party/src/glog/src/glog/log_severity.h|   92 -
 third_party/src/glog/src/glog/logging.h | 1619 --
 third_party/src/glog/src/glog/raw_logging.h |  191 --
 third_party/src/glog/src/glog/stl_logging.h |  183 --
 third_party/src/glog/src/glog/vlog_is_on.h  |  129 --
 third_party/src/glog/src/googletest.h   |  604 --
 third_party/src/glog/src/logging.cc | 2049 -
 .../src/glog/src/logging_striplog_test.sh   |   79 -
 third_party/src/glog/src/logging_striptest10.cc |   35 -
 third_party/src/glog/src/logging_striptest2.cc  |   35 -
 .../src/glog/src/logging_striptest_main.cc  |   73 -
 third_party/src/glog/src/logging_unittest.cc| 1215 ---
 third_party/src/glog/src/logging_unittest.err   |  305 ---
 third_party/src/glog/src/mock-log.h |  155 --
 third_party/src/glog/src/mock-log_test.cc   |  106 -
 third_party/src/glog/src/raw_logging.cc |  172 --
 third_party/src/glog/src/signalhandler.cc   |  350 ---
 .../src/glog/src/signalhandler_unittest.cc  |   97 -
 .../src/glog/src/signalhandler_unittest.sh  |  131 --
 third_party/src/glog/src/stacktrace.h   |   60 -
 .../src/glog/src/stacktrace_generic-inl.h   |   59 -
 .../src/glog/src/stacktrace_libunwind-inl.h |   87 -
 .../src/glog/src/stacktrace_powerpc-inl.h   |  130 --
 third_party/src/glog/src/stacktrace_unittest.cc |  208 --
 third_party/src/glog/src/stacktrace_x86-inl.h   |  139 --
 .../src/glog/src/stacktrace_x86_64-inl.h|  109 -
 .../src/glog/src/stl_logging_unittest.cc|  182 --
 third_party/src/glog/src/symbolize.cc   |  681 --
 third_party/src/glog/src/symbolize.h|  116 -
 third_party/src/glog/src/symbolize_unittest.cc  |  365 
 third_party/src/glog/src/utilities.cc   |  347 ---
 third_party/src/glog/src/utilities.h|  226 --
 third_party/src/glog/src/utilities_unittest.cc  |   54 -
 third_party/src/glog/src/vlog_is_on.cc  |  249 ---
 .../glog/src/windows/base/commandlineflags.h|  133 --
 .../src/glog/src/windows/base/googleinit.h  |   51 -
 third_party/src/glog/src/windows/base/mutex.h   |  331 ---
 .../src/glog/src/windows/config_cmake.h.in  |  142 --
 .../src/glog/src/windows/glog/log_severity.h|   96 -
 third_party/src/glog/src/windows/glog/logging.h | 1603 --
 .../src/glog/src/windows/glog/raw_logging.h |  189 --
 .../src/glog/src/windows/glog/stl_logging.h |  187 --
 .../src/glog/src/windows/glog/vlog_is_on.h  |  133 --
 third_party/src/glog/src/windows/logging.cc | 2050 --
 third_party/src/glog/src/windows/port.cc|   

[09/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/glog/log_severity.h
--
diff --git a/third_party/src/glog/src/glog/log_severity.h 
b/third_party/src/glog/src/glog/log_severity.h
deleted file mode 100644
index 99945a4..000
--- a/third_party/src/glog/src/glog/log_severity.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef BASE_LOG_SEVERITY_H__
-#define BASE_LOG_SEVERITY_H__
-
-// Annoying stuff for windows -- makes sure clients can import these functions
-#ifndef GOOGLE_GLOG_DLL_DECL
-# if defined(_WIN32) && !defined(__CYGWIN__)
-#   define GOOGLE_GLOG_DLL_DECL  __declspec(dllimport)
-# else
-#   define GOOGLE_GLOG_DLL_DECL
-# endif
-#endif
-
-// Variables of type LogSeverity are widely taken to lie in the range
-// [0, NUM_SEVERITIES-1].  Be careful to preserve this assumption if
-// you ever need to change their values or add a new severity.
-typedef int LogSeverity;
-
-const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3,
-  NUM_SEVERITIES = 4;
-#ifndef GLOG_NO_ABBREVIATED_SEVERITIES
-# ifdef ERROR
-#  error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before 
including logging.h. See the document for detail.
-# endif
-const int INFO = GLOG_INFO, WARNING = GLOG_WARNING,
-  ERROR = GLOG_ERROR, FATAL = GLOG_FATAL;
-#endif
-
-// DFATAL is FATAL in debug mode, ERROR in normal mode
-#ifdef NDEBUG
-#define DFATAL_LEVEL ERROR
-#else
-#define DFATAL_LEVEL FATAL
-#endif
-
-extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES];
-
-// NDEBUG usage helpers related to (RAW_)DCHECK:
-//
-// DEBUG_MODE is for small !NDEBUG uses like
-//   if (DEBUG_MODE) foo.CheckThatFoo();
-// instead of substantially more verbose
-//   #ifndef NDEBUG
-// foo.CheckThatFoo();
-//   #endif
-//
-// IF_DEBUG_MODE is for small !NDEBUG uses like
-//   IF_DEBUG_MODE( string error; )
-//   DCHECK(Foo(&error)) << error;
-// instead of substantially more verbose
-//   #ifndef NDEBUG
-// string error;
-// DCHECK(Foo(&error)) << error;
-//   #endif
-//
-#ifdef NDEBUG
-enum { DEBUG_MODE = 0 };
-#define IF_DEBUG_MODE(x)
-#else
-enum { DEBUG_MODE = 1 };
-#define IF_DEBUG_MODE(x) x
-#endif
-
-#endif  // BASE_LOG_SEVERITY_H__

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/glog/logging.h
--
diff --git a/third_party/src/glog/src/glog/logging.h 
b/third_party/src/glog/src/glog/logging.h
deleted file mode 100644
index 8a6dca0..000
--- a/third_party/src/glog/src/glog/logging.h
+++ /dev/null
@@ -1,1619 +0,0 @@
-// Copyright (c) 1999, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or pro

[05/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/signalhandler.cc
--
diff --git a/third_party/src/glog/src/signalhandler.cc 
b/third_party/src/glog/src/signalhandler.cc
deleted file mode 100644
index d6c203b..000
--- a/third_party/src/glog/src/signalhandler.cc
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Satoru Takabayashi
-//
-// Implementation of InstallFailureSignalHandler().
-
-#include "utilities.h"
-#include "stacktrace.h"
-#include "symbolize.h"
-#include "glog/logging.h"
-
-#include 
-#include 
-#ifdef HAVE_UCONTEXT_H
-# include 
-#endif
-#ifdef HAVE_SYS_UCONTEXT_H
-# include 
-#endif
-#include 
-
-_START_GOOGLE_NAMESPACE_
-
-namespace {
-
-// We'll install the failure signal handler for these signals.  We could
-// use strsignal() to get signal names, but we don't use it to avoid
-// introducing yet another #ifdef complication.
-//
-// The list should be synced with the comment in signalhandler.h.
-const struct {
-  int number;
-  const char *name;
-} kFailureSignals[] = {
-  { SIGSEGV, "SIGSEGV" },
-  { SIGILL, "SIGILL" },
-  { SIGFPE, "SIGFPE" },
-  { SIGABRT, "SIGABRT" },
-  { SIGBUS, "SIGBUS" },
-  { SIGTERM, "SIGTERM" },
-};
-
-// Returns the program counter from signal context, NULL if unknown.
-void* GetPC(void* ucontext_in_void) {
-#if (defined(HAVE_UCONTEXT_H) || defined(HAVE_SYS_UCONTEXT_H)) && 
defined(PC_FROM_UCONTEXT)
-  if (ucontext_in_void != NULL) {
-ucontext_t *context = reinterpret_cast(ucontext_in_void);
-return (void*)context->PC_FROM_UCONTEXT;
-  }
-#endif
-  return NULL;
-}
-
-// The class is used for formatting error messages.  We don't use printf()
-// as it's not async signal safe.
-class MinimalFormatter {
- public:
-  MinimalFormatter(char *buffer, int size)
-  : buffer_(buffer),
-cursor_(buffer),
-end_(buffer + size) {
-  }
-
-  // Returns the number of bytes written in the buffer.
-  int num_bytes_written() const { return cursor_ - buffer_; }
-
-  // Appends string from "str" and updates the internal cursor.
-  void AppendString(const char* str) {
-int i = 0;
-while (str[i] != '\0' && cursor_ + i < end_) {
-  cursor_[i] = str[i];
-  ++i;
-}
-cursor_ += i;
-  }
-
-  // Formats "number" in "radix" and updates the internal cursor.
-  // Lowercase letters are used for 'a' - 'z'.
-  void AppendUint64(uint64 number, int radix) {
-int i = 0;
-while (cursor_ + i < end_) {
-  const int tmp = number % radix;
-  number /= radix;
-  cursor_[i] = (tmp < 10 ? '0' + tmp : 'a' + tmp - 10);
-  ++i;
-  if (number == 0) {
-break;
-  }
-}
-// Reverse the bytes written.
-std::reverse(cursor_, cursor_ + i);
-cursor_ += i;
-  }
-
-  // Formats "number" as hexadecimal number, and updates the internal
-  // cursor.  Padding will be added in front if needed.
-  void AppendHexWithPadding(uint64 number, int width) {
-char* start = cursor_;
-AppendString("0x");
-AppendUint64(number, 16);
-// Move to right and add padding in front if needed.
-if (cursor_ < start + width) {
-  const int64 delta = start + width - cursor_;
-  std::copy(start, cursor_, start + delta);
-  std::fill(start, start + delta, ' ');
-  cursor_ = start + width;
-}
-  }
-
- private:
-  char *buffer_;
-  c

[02/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/windows/logging.cc
--
diff --git a/third_party/src/glog/src/windows/logging.cc 
b/third_party/src/glog/src/windows/logging.cc
deleted file mode 100644
index 5c09a66..000
--- a/third_party/src/glog/src/windows/logging.cc
+++ /dev/null
@@ -1,2050 +0,0 @@
-// Copyright (c) 1999, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#define _GNU_SOURCE 1 // needed for O_NOFOLLOW and pread()/pwrite()
-
-#include "utilities.h"
-
-#include 
-#include 
-#include 
-#include 
-#ifdef HAVE_UNISTD_H
-# include   // For _exit.
-#endif
-#include 
-#include 
-#include 
-#ifdef HAVE_SYS_UTSNAME_H
-# include   // For uname.
-#endif
-#include 
-#include 
-#include 
-#include 
-#include 
-#ifdef HAVE_PWD_H
-# include 
-#endif
-#ifdef HAVE_SYSLOG_H
-# include 
-#endif
-#include 
-#include// for errno
-#include 
-#include "base/commandlineflags.h"// to get the program name
-#include "glog/logging.h"
-#include "glog/raw_logging.h"
-#include "base/googleinit.h"
-
-#ifdef HAVE_STACKTRACE
-# include "stacktrace.h"
-#endif
-
-using std::string;
-using std::vector;
-using std::setw;
-using std::setfill;
-using std::hex;
-using std::dec;
-using std::min;
-using std::ostream;
-using std::ostringstream;
-
-using std::FILE;
-using std::fwrite;
-using std::fclose;
-using std::fflush;
-using std::fprintf;
-using std::perror;
-
-#ifdef __QNX__
-using std::fdopen;
-#endif
-
-// There is no thread annotation support.
-#define EXCLUSIVE_LOCKS_REQUIRED(mu)
-
-static bool BoolFromEnv(const char *varname, bool defval) {
-  const char* const valstr = getenv(varname);
-  if (!valstr) {
-return defval;
-  }
-  return memchr("tTyY1\0", valstr[0], 6) != NULL;
-}
-
-GLOG_DEFINE_bool(logtostderr, BoolFromEnv("GOOGLE_LOGTOSTDERR", false),
- "log messages go to stderr instead of logfiles");
-GLOG_DEFINE_bool(alsologtostderr, BoolFromEnv("GOOGLE_ALSOLOGTOSTDERR", false),
- "log messages go to stderr in addition to logfiles");
-GLOG_DEFINE_bool(colorlogtostderr, false,
- "color messages logged to stderr (if supported by terminal)");
-#ifdef OS_LINUX
-GLOG_DEFINE_bool(drop_log_memory, true, "Drop in-memory buffers of log 
contents. "
- "Logs can grow very quickly and they are rarely read before 
they "
- "need to be evicted from memory. Instead, drop them from 
memory "
- "as soon as they are flushed to disk.");
-_START_GOOGLE_NAMESPACE_
-namespace logging {
-static const int64 kPageSize = getpagesize();
-}
-_END_GOOGLE_NAMESPACE_
-#endif
-
-// By default, errors (including fatal errors) get logged to stderr as
-// well as the file.
-//
-// The default is ERROR instead of FATAL so that users can see problems
-// when they run a program without having to look in another file.
-DEFINE_int32(stderrthreshold,
- GOOGLE_NAMESPACE::GLOG_ERROR,
- "log messages at or above this level are copied to stderr in "
- "addition to logfiles.  This flag obsoletes --alsologtostderr.");
-
-GLOG_DEFINE_string(alsologtoemail, "",
-   "log messages go to these email addresses "
-   "in addition to logfiles");
-GLOG_DEFINE_bool(log_prefix, true,
- "Prepend the log prefix to the start of each log line");
-GLOG_DEFINE_int32(

[04/11] incubator-quickstep git commit: Remove glog source code from third party

2017-12-20 Thread jianqiao
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c43107d1/third_party/src/glog/src/symbolize.h
--
diff --git a/third_party/src/glog/src/symbolize.h 
b/third_party/src/glog/src/symbolize.h
deleted file mode 100644
index 1ebe4dd..000
--- a/third_party/src/glog/src/symbolize.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Satoru Takabayashi
-//
-// This library provides Symbolize() function that symbolizes program
-// counters to their corresponding symbol names on linux platforms.
-// This library has a minimal implementation of an ELF symbol table
-// reader (i.e. it doesn't depend on libelf, etc.).
-//
-// The algorithm used in Symbolize() is as follows.
-//
-//   1. Go through a list of maps in /proc/self/maps and find the map
-//   containing the program counter.
-//
-//   2. Open the mapped file and find a regular symbol table inside.
-//   Iterate over symbols in the symbol table and look for the symbol
-//   containing the program counter.  If such a symbol is found,
-//   obtain the symbol name, and demangle the symbol if possible.
-//   If the symbol isn't found in the regular symbol table (binary is
-//   stripped), try the same thing with a dynamic symbol table.
-//
-// Note that Symbolize() is originally implemented to be used in
-// FailureSignalHandler() in base/google.cc.  Hence it doesn't use
-// malloc() and other unsafe operations.  It should be both
-// thread-safe and async-signal-safe.
-
-#ifndef BASE_SYMBOLIZE_H_
-#define BASE_SYMBOLIZE_H_
-
-#include "utilities.h"
-#include "config.h"
-#include "glog/logging.h"
-
-#ifdef HAVE_SYMBOLIZE
-
-#if defined(__ELF__)  // defined by gcc on Linux
-#include 
-#include   // For ElfW() macro.
-
-// If there is no ElfW macro, let's define it by ourself.
-#ifndef ElfW
-# if SIZEOF_VOID_P == 4
-#  define ElfW(type) Elf32_##type
-# elif SIZEOF_VOID_P == 8
-#  define ElfW(type) Elf64_##type
-# else
-#  error "Unknown sizeof(void *)"
-# endif
-#endif
-
-_START_GOOGLE_NAMESPACE_
-
-// Gets the section header for the given name, if it exists. Returns true on
-// success. Otherwise, returns false.
-bool GetSectionHeaderByName(int fd, const char *name, size_t name_len,
-ElfW(Shdr) *out);
-
-_END_GOOGLE_NAMESPACE_
-
-#endif  /* __ELF__ */
-
-_START_GOOGLE_NAMESPACE_
-
-// Installs a callback function, which will be called right before a symbol 
name
-// is printed. The callback is intended to be used for showing a file name and 
a
-// line number preceding a symbol name.
-// "fd" is a file descriptor of the object file containing the program
-// counter "pc". The callback function should write output to "out"
-// and return the size of the output written. On error, the callback
-// function should return -1.
-typedef int (*SymbolizeCallback)(int fd, void *pc, char *out, size_t out_size,
- uint64 relocation);
-void InstallSymbolizeCallback(SymbolizeCallback callback);
-
-_END_GOOGLE_NAMESPACE_
-
-#endif
-
-_START_GOOGLE_NAMESPACE_
-
-// Symbolizes a program counter.  On success, returns true and write the
-// symbol name to "out".  The symbol name is demangled if possible
-// (supports symbols generated by GCC 3.x or newer).  Otherwise,
-// returns false.
-bool Symbolize(void *pc, char *out, int out_size);
-
-_END_GOOGLE_NAMESPACE_
-
-#endif  // BASE_SYMBOL