kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/5] kudu git commit: twitter-demo: remove module
Date Wed, 18 Oct 2017 19:25:30 GMT
Repository: kudu
Updated Branches:
  refs/heads/master aa7d6a97b -> f96ab36ad


http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/ingest_firehose.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/ingest_firehose.cc b/src/kudu/twitter-demo/ingest_firehose.cc
deleted file mode 100644
index cfb3086..0000000
--- a/src/kudu/twitter-demo/ingest_firehose.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-// 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 <fstream>  // IWYU pragma: keep
-#include <iostream>
-#include <string>
-#include <type_traits>
-#include <utility>
-
-#include <gflags/gflags.h>
-#include <glog/logging.h>
-
-#include "kudu/client/client.h"
-#include "kudu/client/shared_ptr.h"
-#include "kudu/gutil/gscoped_ptr.h"
-#include "kudu/gutil/move.h"
-#include "kudu/gutil/port.h"
-#include "kudu/twitter-demo/insert_consumer.h"
-#include "kudu/twitter-demo/twitter_streamer.h"
-#include "kudu/util/flags.h"
-#include "kudu/util/logging.h"
-#include "kudu/util/slice.h"
-#include "kudu/util/status.h"
-
-DEFINE_string(twitter_firehose_sink, "console",
-              "Where to write firehose output.\n"
-              "Valid values: console,rpc");
-DEFINE_string(twitter_rpc_master_address, "localhost",
-              "Address of master for the cluster to write to");
-
-DEFINE_string(twitter_firehose_source, "api",
-              "Where to obtain firehose input.\n"
-              "Valid values: api,file");
-DEFINE_string(twitter_firehose_file, "/dev/fd/0",
-              "File to read firehose data from, if 'file' is configured.");
-
-
-using std::string;
-
-namespace kudu {
-namespace twitter_demo {
-
-using client::sp::shared_ptr;
-
-// Consumer which simply logs messages to the console.
-class LoggingConsumer : public TwitterConsumer {
- public:
-  virtual void ConsumeJSON(const Slice& json) OVERRIDE {
-    std::cout << json.ToString();
-  }
-};
-
-gscoped_ptr<TwitterConsumer> CreateInsertConsumer() {
-  shared_ptr<client::KuduClient> client;
-  CHECK_OK(client::KuduClientBuilder()
-           .add_master_server_addr(FLAGS_twitter_rpc_master_address)
-           .Build(&client));
-
-  gscoped_ptr<InsertConsumer> ret(new InsertConsumer(client));
-  CHECK_OK(ret->Init());
-  return gscoped_ptr<TwitterConsumer>(std::move(ret)); // up-cast
-}
-
-static void IngestFromFile(const string& file, gscoped_ptr<TwitterConsumer> consumer)
{
-  std::ifstream in(file.c_str());
-  CHECK(in.is_open()) << "Couldn't open " << file;
-
-  string line;
-  while (std::getline(in, line)) {
-    consumer->ConsumeJSON(line);
-  }
-}
-
-static int main(int argc, char** argv) {
-  // Since this is meant to be run by a user, not a daemon,
-  // log to stderr by default.
-  FLAGS_logtostderr = 1;
-  kudu::ParseCommandLineFlags(&argc, &argv, true);
-  kudu::InitGoogleLoggingSafe(argv[0]);
-
-  gscoped_ptr<TwitterConsumer> consumer;
-  if (FLAGS_twitter_firehose_sink == "console") {
-    consumer.reset(new LoggingConsumer);
-  } else if (FLAGS_twitter_firehose_sink == "rpc") {
-    consumer = CreateInsertConsumer();
-  } else {
-    LOG(FATAL) << "Unknown sink: " << FLAGS_twitter_firehose_sink;
-  }
-
-  if (FLAGS_twitter_firehose_source == "api") {
-    TwitterStreamer streamer(consumer.get());
-    CHECK_OK(streamer.Init());
-    CHECK_OK(streamer.Start());
-    CHECK_OK(streamer.Join());
-  } else if (FLAGS_twitter_firehose_source == "file") {
-    IngestFromFile(FLAGS_twitter_firehose_file, std::move(consumer));
-  } else {
-    LOG(FATAL) << "Unknown source: " << FLAGS_twitter_firehose_source;
-  }
-  return 0;
-}
-
-} // namespace twitter_demo
-} // namespace kudu
-
-int main(int argc, char** argv) {
-  return kudu::twitter_demo::main(argc, argv);
-}

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/insert_consumer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/insert_consumer.cc b/src/kudu/twitter-demo/insert_consumer.cc
deleted file mode 100644
index 946f3dc..0000000
--- a/src/kudu/twitter-demo/insert_consumer.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-// 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/twitter-demo/insert_consumer.h"
-
-#include <ostream>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include <glog/logging.h>
-
-#include "kudu/client/client.h"
-#include "kudu/client/write_op.h"
-#include "kudu/common/partial_row.h"
-#include "kudu/gutil/gscoped_ptr.h"
-#include "kudu/gutil/stl_util.h"
-#include "kudu/twitter-demo/parser.h"
-#include "kudu/twitter-demo/twitter-schema.h"
-#include "kudu/util/status.h"
-
-using kudu::client::KuduInsert;
-using kudu::client::KuduClient;
-using kudu::client::KuduSession;
-using kudu::client::KuduTableCreator;
-using std::string;
-using std::vector;
-
-namespace kudu {
-namespace twitter_demo {
-
-InsertConsumer::InsertConsumer(client::sp::shared_ptr<KuduClient> client)
-  : initted_(false),
-    schema_(CreateTwitterSchema()),
-    client_(std::move(client)) {
-}
-
-Status InsertConsumer::Init() {
-  static const string kTableName = "twitter";
-  Status s = client_->OpenTable(kTableName, &table_);
-  if (s.IsNotFound()) {
-    gscoped_ptr<KuduTableCreator> table_creator(client_->NewTableCreator());
-    RETURN_NOT_OK_PREPEND(table_creator->table_name(kTableName)
-                          .schema(&schema_)
-                          .Create(),
-                          "Couldn't create twitter table");
-    s = client_->OpenTable(kTableName, &table_);
-  }
-  RETURN_NOT_OK_PREPEND(s, "Couldn't open twitter table");
-
-  session_ = client_->NewSession();
-  session_->SetTimeoutMillis(1000);
-  RETURN_NOT_OK(session_->SetFlushMode(KuduSession::AUTO_FLUSH_BACKGROUND));
-  initted_ = true;
-  return Status::OK();
-}
-
-InsertConsumer::~InsertConsumer() {
-  Status s(session_->Flush());
-  if (!s.ok()) {
-    bool overflow;
-    vector<client::KuduError*> errors;
-    ElementDeleter d(&errors);
-    session_->GetPendingErrors(&errors, &overflow);
-    for (const client::KuduError* error : errors) {
-      LOG(WARNING) << "Failed to insert row " << error->failed_op().ToString()
-                   << ": " << error->status().ToString();
-    }
-  }
-}
-
-void InsertConsumer::ConsumeJSON(const Slice& json_slice) {
-  CHECK(initted_);
-  string json = json_slice.ToString();
-  Status s = parser_.Parse(json, &event_);
-  if (!s.ok()) {
-    LOG(WARNING) << "Unable to parse JSON string: " << json << ": " <<
s.ToString();
-    return;
-  }
-
-  if (event_.type == DELETE_TWEET) {
-    // Not currently supported.
-    return;
-  }
-
-  string created_at = TwitterEventParser::ReformatTime(event_.tweet_event.created_at);
-
-  gscoped_ptr<KuduInsert> ins(table_->NewInsert());
-  KuduPartialRow* r = ins->mutable_row();
-  CHECK_OK(r->SetInt64("tweet_id", event_.tweet_event.tweet_id));
-  CHECK_OK(r->SetStringCopy("text", event_.tweet_event.text));
-  CHECK_OK(r->SetStringCopy("source", event_.tweet_event.source));
-  CHECK_OK(r->SetStringCopy("created_at", created_at));
-  CHECK_OK(r->SetInt64("user_id", event_.tweet_event.user_id));
-  CHECK_OK(r->SetStringCopy("user_name", event_.tweet_event.user_name));
-  CHECK_OK(r->SetStringCopy("user_description", event_.tweet_event.user_description));
-  CHECK_OK(r->SetStringCopy("user_location", event_.tweet_event.user_location));
-  CHECK_OK(r->SetInt32("user_followers_count", event_.tweet_event.user_followers_count));
-  CHECK_OK(r->SetInt32("user_friends_count", event_.tweet_event.user_friends_count));
-  CHECK_OK(r->SetStringCopy("user_image_url", event_.tweet_event.user_image_url));
-  CHECK_OK(session_->Apply(ins.release()));
-}
-
-} // namespace twitter_demo
-} // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/insert_consumer.h
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/insert_consumer.h b/src/kudu/twitter-demo/insert_consumer.h
deleted file mode 100644
index 368215f..0000000
--- a/src/kudu/twitter-demo/insert_consumer.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// 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.
-#ifndef KUDU_TWITTER_DEMO_INSERT_CONSUMER_H
-#define KUDU_TWITTER_DEMO_INSERT_CONSUMER_H
-
-#include "kudu/twitter-demo/twitter_streamer.h"
-
-#include "kudu/client/schema.h"
-#include "kudu/client/shared_ptr.h"
-#include "kudu/gutil/port.h"
-#include "kudu/twitter-demo/parser.h"
-#include "kudu/util/slice.h"
-#include "kudu/util/status.h"
-
-namespace kudu {
-namespace client {
-class KuduClient;
-class KuduTable;
-class KuduSession;
-} // namespace client
-
-namespace twitter_demo {
-
-// Consumer of tweet data which parses the JSON and inserts
-// into a remote tablet via RPC.
-class InsertConsumer : public TwitterConsumer {
- public:
-  explicit InsertConsumer(client::sp::shared_ptr<client::KuduClient> client);
-  ~InsertConsumer();
-
-  Status Init();
-
-  virtual void ConsumeJSON(const Slice& json_slice) OVERRIDE;
-
- private:
-  bool initted_;
-
-  client::KuduSchema schema_;
-  TwitterEventParser parser_;
-
-  // Reusable object for latest event.
-  TwitterEvent event_;
-
-  client::sp::shared_ptr<client::KuduClient> client_;
-  client::sp::shared_ptr<client::KuduSession> session_;
-  client::sp::shared_ptr<client::KuduTable> table_;
-};
-
-} // namespace twitter_demo
-} // namespace kudu
-#endif

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/oauth-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/oauth-test.cc b/src/kudu/twitter-demo/oauth-test.cc
deleted file mode 100644
index 3b9e922..0000000
--- a/src/kudu/twitter-demo/oauth-test.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// 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/twitter-demo/oauth.h"
-
-#include <gtest/gtest.h>
-#include <string>
-
-#include "kudu/util/debug/leakcheck_disabler.h"
-
-using std::string;
-
-namespace kudu {
-namespace twitter_demo {
-
-// Test case from Appendix A of the OAuth 1.0 standard:
-// http://oauth.net/core/1.0/
-TEST(OAuthTest, TestSignature) {
-  const string kConsumerKey = "dpf43f3p2l4k3l03";
-  const string kConsumerSecret = "kd94hf93k423kf44";
-  const string kTokenKey = "nnch734d00sl2jdk";
-  const string kTokenSecret = "pfkkdhi9sl3r4s00";
-
-  // Necessary to squelch a leak originating in the NSS SSL library.
-  debug::ScopedLeakCheckDisabler disabler;
-
-  OAuthRequest req("GET", "http://photos.example.net/photos");
-
-  req.AddPair("oauth_consumer_key", kConsumerKey);
-  req.AddPair("oauth_token", kTokenKey);
-  req.AddPair("oauth_signature_method", "HMAC-SHA1");
-  req.AddPair("oauth_timestamp", "1191242096");
-  req.AddPair("oauth_nonce", "kllo9940pd9333jh");
-  req.AddPair("oauth_version", "1.0");
-  req.AddPair("file", "vacation.jpg");
-  req.AddPair("size", "original");
-  string base = req.SignatureBaseString();
-  ASSERT_EQ(string("GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26"
-                   "oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26"
-                   "oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26"
-                   "oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal"),
-            base);
-
-  string sig = req.Signature(kConsumerSecret, kTokenSecret);
-  ASSERT_EQ("tR3+Ty81lMeYAr/Fid0kMTYa/WM=", sig);
-}
-
-
-} // namespace twitter_demo
-} // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/oauth.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/oauth.cc b/src/kudu/twitter-demo/oauth.cc
deleted file mode 100644
index 088463c..0000000
--- a/src/kudu/twitter-demo/oauth.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-// 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/twitter-demo/oauth.h"
-
-#include <algorithm>
-#include <ctime>
-#include <vector>
-
-#include <glog/logging.h>
-extern "C" {
-#include <oauth.h>
-}
-
-#include "kudu/gutil/gscoped_ptr.h"
-#include "kudu/gutil/strings/util.h"
-
-using std::pair;
-using std::string;
-using std::vector;
-
-namespace kudu {
-namespace twitter_demo {
-
-static string EscapeUrl(const string& str) {
-  gscoped_ptr<char, FreeDeleter> enc(oauth_url_escape(str.c_str()));
-  return string(enc.get());
-}
-
-static string GenerateNonce() {
-  gscoped_ptr<char, FreeDeleter> ret(oauth_gen_nonce());
-  return string(ret.get());
-}
-
-
-OAuthRequest::OAuthRequest(const string& http_method,
-                           const string& url)
-  : http_method_(http_method),
-    url_(url) {
-}
-
-void OAuthRequest::AddStandardOAuthFields(const string& consumer_key,
-                                          const string& token_key) {
-  AddPair("oauth_version", "1.0");
-  AddPair("oauth_signature_method", "HMAC-SHA1");
-  AddPair("oauth_nonce", GenerateNonce());
-  AddPair("oauth_timestamp", std::to_string(time(nullptr)));
-  AddPair("oauth_consumer_key", consumer_key);
-  AddPair("oauth_token", token_key);
-}
-
-void OAuthRequest::AddPair(const string& key, const string& value) {
-  kv_pairs_.push_back(std::make_pair(key, value));
-}
-
-static bool ComparePair(const pair<std::string, std::string>& a,
-                        const pair<std::string, std::string>& b) {
-  if (a.first < b.first) return true;
-  else if (a.first > b.first) return false;
-
-  return a.second < b.second;
-}
-
-string OAuthRequest::SignatureBaseString() const {
-  vector<pair<string, string> > sorted_pairs(kv_pairs_);
-  std::sort(sorted_pairs.begin(), sorted_pairs.end(), &ComparePair);
-  string ret;
-  ret.append(http_method_);
-  ret.append("&");
-  ret.append(EscapeUrl(url_));
-
-  string kvpairs;
-  bool first = true;
-  for (const StringPair& p : sorted_pairs) {
-    if (!first) {
-      kvpairs.append("&");
-    }
-    first = false;
-    kvpairs.append(p.first);
-    kvpairs.append("=");
-    kvpairs.append(EscapeUrl(p.second));
-  }
-  ret.append("&");
-  ret.append(EscapeUrl(kvpairs));
-  return ret;
-}
-
-string OAuthRequest::Signature(const string& consumer_secret,
-                               const string& token_secret) const {
-  string base = SignatureBaseString();
-  string key = consumer_secret + "&" + token_secret;
-  gscoped_ptr<char, FreeDeleter> hmacced(
-    oauth_sign_hmac_sha1_raw(base.c_str(), base.size(), key.c_str(), key.size()));
-  CHECK(hmacced.get());
-  return string(hmacced.get());
-}
-
-string OAuthRequest::AuthHeader(const string& consumer_secret,
-                                const string& token_secret) const {
-  string sig = Signature(consumer_secret, token_secret);
-
-  string ret = "Authorization: OAuth realm=\"\"";
-  for (const StringPair& p : kv_pairs_) {
-    if (!HasPrefixString(p.first, "oauth_")) continue;
-    ret.append(", ");
-    ret.append(p.first).append("=\"").append(EscapeUrl(p.second)).append("\"");
-  }
-  ret.append(", oauth_signature_method=\"HMAC-SHA1\"");
-  ret.append(", oauth_signature=\"").append(EscapeUrl(sig)).append("\"");
-  return ret;
-}
-
-} // namespace twitter_demo
-} // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/oauth.h
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/oauth.h b/src/kudu/twitter-demo/oauth.h
deleted file mode 100644
index b24f454..0000000
--- a/src/kudu/twitter-demo/oauth.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// 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.
-#ifndef KUDU_TWITTERDEMO_OAUTH_H
-#define KUDU_TWITTERDEMO_OAUTH_H
-
-#include <gtest/gtest_prod.h>
-
-#include <string>
-#include <utility>
-#include <vector>
-
-namespace kudu {
-namespace twitter_demo {
-
-// An OpenAuth-authenticated request. See oauth-test.cc for
-// usage examples.
-class OAuthRequest {
- private:
-  typedef std::pair<std::string, std::string> StringPair;
-
- public:
-  OAuthRequest(const std::string& http_method,
-               const std::string& url);
-
-  // Add a key-value pair to the OAauth request.
-  void AddPair(const std::string& key, const std::string& value);
-
-  // Add the standard OAuth fields to the request, including
-  // generating a nonce and filling in the request timestamp.
-  void AddStandardOAuthFields(const std::string& consumer_key,
-                              const std::string& token_key);
-
-  // Generate the HTTP Authorization header to authenticate this request.
-  // This is the entire header, including the 'Authorization: ' prefix.
-  std::string AuthHeader(const std::string& consumer_secret,
-                         const std::string& token_secret) const;
-
- private:
-  FRIEND_TEST(OAuthTest, TestSignature);
-
-  std::string SignatureBaseString() const;
-  std::string Signature(const std::string& consumer_secret,
-                        const std::string& token_secret) const;
-
-  std::string http_method_;
-  std::string url_;
-
-  // The entries used in the request.
-  std::vector<StringPair > kv_pairs_;
-};
-
-} // namespace twitter_demo
-} // namespace kudu
-#endif

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/parser-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/parser-test.cc b/src/kudu/twitter-demo/parser-test.cc
deleted file mode 100644
index 8d34663..0000000
--- a/src/kudu/twitter-demo/parser-test.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// 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/twitter-demo/parser.h"
-
-#include <string>
-#include <vector>
-
-#include <glog/logging.h>
-#include <gtest/gtest.h>
-
-#include "kudu/gutil/strings/split.h"
-#include "kudu/util/env.h"
-#include "kudu/util/faststring.h"
-#include "kudu/util/path_util.h"
-#include "kudu/util/status.h"
-#include "kudu/util/test_macros.h"
-
-using std::string;
-using std::vector;
-
-namespace kudu {
-namespace twitter_demo {
-
-// Return the directory of the currently-running executable.
-static string GetExecutableDir() {
-  string exec;
-  CHECK_OK(Env::Default()->GetExecutablePath(&exec));
-  return DirName(exec);
-}
-
-static Status LoadFile(const string& name, vector<string>* lines) {
-  string path = JoinPathSegments(GetExecutableDir(), name);
-  faststring data;
-  RETURN_NOT_OK(ReadFileToString(Env::Default(), path, &data));
-
-  *lines = strings::Split(data.ToString(), "\n");
-  return Status::OK();
-}
-
-static void EnsureFileParses(const char* file, TwitterEventType expected_type) {
-  TwitterEventParser p;
-  TwitterEvent event;
-
-  SCOPED_TRACE(file);
-  vector<string> jsons;
-  CHECK_OK(LoadFile(file, &jsons));
-
-  int line_number = 1;
-  for (const string& json : jsons) {
-    if (json.empty()) continue;
-    SCOPED_TRACE(json);
-    SCOPED_TRACE(line_number);
-    ASSERT_OK(p.Parse(json, &event));
-    ASSERT_EQ(expected_type, event.type);
-    line_number++;
-  }
-}
-
-// example-tweets.txt includes a few hundred tweets collected
-// from the sample hose.
-TEST(ParserTest, TestParseTweets) {
-  EnsureFileParses("example-tweets.txt", TWEET);
-}
-
-// example-deletes.txt includes a few hundred deletes collected
-// from the sample hose.
-TEST(ParserTest, TestParseDeletes) {
-  EnsureFileParses("example-deletes.txt", DELETE_TWEET);
-}
-
-TEST(ParserTest, TestReformatTime) {
-  ASSERT_EQ("20130814063107", TwitterEventParser::ReformatTime("Wed Aug 14 06:31:07 +0000
2013"));
-}
-
-} // namespace twitter_demo
-} // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/parser.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/parser.cc b/src/kudu/twitter-demo/parser.cc
deleted file mode 100644
index 7df1793..0000000
--- a/src/kudu/twitter-demo/parser.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-// 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/twitter-demo/parser.h"
-
-#include <cstring>
-#include <ctime>
-
-#include <glog/logging.h>
-#include <rapidjson/document.h>
-
-#include "kudu/gutil/stringprintf.h"
-#include "kudu/util/jsonreader.h"
-
-namespace kudu {
-namespace twitter_demo {
-
-TwitterEventParser::TwitterEventParser() {
-}
-
-TwitterEventParser::~TwitterEventParser() {
-}
-
-static Status ParseDelete(const JsonReader& r,
-                          const rapidjson::Value* delete_obj,
-                          TwitterEvent* event) {
-  event->type = DELETE_TWEET;
-  DeleteTweetEvent* e = &event->delete_event;
-
-  const rapidjson::Value* status_obj;
-  RETURN_NOT_OK(r.ExtractObject(delete_obj, "status", &status_obj));
-  RETURN_NOT_OK(r.ExtractInt64(status_obj, "id", &e->tweet_id));
-  RETURN_NOT_OK(r.ExtractInt64(status_obj, "user_id", &e->user_id));
-  return Status::OK();
-}
-
-static Status ParseTweet(const JsonReader& r,
-                         TwitterEvent* event) {
-  event->type = TWEET;
-  TweetEvent* e = &event->tweet_event;
-
-  RETURN_NOT_OK(r.ExtractString(r.root(), "created_at", &e->created_at));
-  RETURN_NOT_OK(r.ExtractInt64(r.root(), "id", &e->tweet_id));
-  RETURN_NOT_OK(r.ExtractString(r.root(), "text", &e->text));
-  RETURN_NOT_OK(r.ExtractString(r.root(), "source", &e->source));
-
-  const rapidjson::Value* user_obj;
-  RETURN_NOT_OK(r.ExtractObject(r.root(), "user", &user_obj));
-  RETURN_NOT_OK(r.ExtractInt64(user_obj, "id", &e->user_id));
-  RETURN_NOT_OK(r.ExtractString(user_obj, "name", &e->user_name));
-  RETURN_NOT_OK(r.ExtractString(user_obj, "location", &e->user_location));
-  RETURN_NOT_OK(r.ExtractString(user_obj, "description", &e->user_description));
-  RETURN_NOT_OK(r.ExtractInt32(user_obj, "followers_count", &e->user_followers_count));
-  RETURN_NOT_OK(r.ExtractInt32(user_obj, "friends_count", &e->user_friends_count));
-  RETURN_NOT_OK(r.ExtractString(user_obj, "profile_image_url", &e->user_image_url));
-
-  return Status::OK();
-}
-
-Status TwitterEventParser::Parse(const std::string& json, TwitterEvent* event) {
-  JsonReader r(json);
-  RETURN_NOT_OK(r.Init());
-  const rapidjson::Value* delete_obj;
-  Status s = r.ExtractObject(r.root(), "delete", &delete_obj);
-  if (s.IsNotFound()) {
-    return ParseTweet(r, event);
-  }
-  RETURN_NOT_OK(s);
-  return ParseDelete(r, delete_obj, event);
-}
-
-std::string TwitterEventParser::ReformatTime(const std::string& twitter_time) {
-  struct tm t;
-  memset(&t, 0, sizeof(t));
-  // Example: Wed Aug 14 06:31:07 +0000 2013
-  char* x = strptime(twitter_time.c_str(), "%a %b %d %H:%M:%S +0000 %Y", &t);
-  if (*x != '\0') {
-    return StringPrintf("unparseable date, date=%s, leftover=%s", twitter_time.c_str(), x);
-  }
-
-  char buf[100];
-  size_t n = strftime(buf, arraysize(buf), "%Y%m%d%H%M%S", &t);
-  CHECK_GT(n, 0);
-  return buf;
-}
-
-
-} // namespace twitter_demo
-} // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/parser.h
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/parser.h b/src/kudu/twitter-demo/parser.h
deleted file mode 100644
index 9973428..0000000
--- a/src/kudu/twitter-demo/parser.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// 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.
-#ifndef KUDU_TWITTER_DEMO_PARSER_H
-#define KUDU_TWITTER_DEMO_PARSER_H
-
-#include <cstdint>
-#include <string>
-
-#include "kudu/gutil/macros.h"
-#include "kudu/util/status.h"
-
-namespace kudu {
-namespace twitter_demo {
-
-enum TwitterEventType {
-  NONE = 0,
-  TWEET = 1,
-  DELETE_TWEET = 2
-};
-
-
-struct TweetEvent {
-  int64_t tweet_id;
-  std::string text;
-  std::string source;
-  std::string created_at;
-  // TODO: add geolocation
-  int64_t user_id;
-  std::string user_name;
-  std::string user_description;
-  std::string user_location;
-  int32_t user_followers_count;
-  int32_t user_friends_count;
-  std::string user_image_url;
-};
-
-struct DeleteTweetEvent {
-  int64_t tweet_id;
-  int64_t user_id;
-};
-
-struct TwitterEvent {
-  TwitterEvent() : type(NONE) {}
-
-  // The type of event. Only one of the various events below will
-  // be valid, depending on this type value.
-  TwitterEventType type;
-
-  // The different event types. These are separate fields rather than
-  // a union so that we can reuse string storage when parsing multiple
-  // events.
-
-  TweetEvent tweet_event;
-  DeleteTweetEvent delete_event;
-};
-
-class TwitterEventParser {
- public:
-  TwitterEventParser();
-  ~TwitterEventParser();
-
-  Status Parse(const std::string& json, TwitterEvent* event);
-
-  static std::string ReformatTime(const std::string& time);
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(TwitterEventParser);
-};
-
-} // namespace twitter_demo
-} // namespace kudu
-#endif

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/twitter-schema.h
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/twitter-schema.h b/src/kudu/twitter-demo/twitter-schema.h
deleted file mode 100644
index d54d51c..0000000
--- a/src/kudu/twitter-demo/twitter-schema.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// 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.
-//
-// Inline functions to create the Twitter schema
-#ifndef KUDU_TWITTER_DEMO_TWITTER_SCHEMA_H
-#define KUDU_TWITTER_DEMO_TWITTER_SCHEMA_H
-
-#include "kudu/client/schema.h"
-
-namespace kudu {
-namespace twitter_demo {
-
-inline client::KuduSchema CreateTwitterSchema() {
-  using client::KuduColumnSchema;
-
-  client::KuduSchema s;
-  client::KuduSchemaBuilder b;
-  b.AddColumn("tweet_id")->Type(KuduColumnSchema::INT64)->NotNull()->PrimaryKey();
-  b.AddColumn("text")->Type(KuduColumnSchema::STRING)->NotNull();
-  b.AddColumn("source")->Type(KuduColumnSchema::STRING)->NotNull();
-  b.AddColumn("created_at")->Type(KuduColumnSchema::STRING)->NotNull();
-  b.AddColumn("user_id")->Type(KuduColumnSchema::INT64)->NotNull();
-  b.AddColumn("user_name")->Type(KuduColumnSchema::STRING)->NotNull();
-  b.AddColumn("user_description")->Type(KuduColumnSchema::STRING)->NotNull();
-  b.AddColumn("user_location")->Type(KuduColumnSchema::STRING)->NotNull();
-  b.AddColumn("user_followers_count")->Type(KuduColumnSchema::INT32)->NotNull();
-  b.AddColumn("user_friends_count")->Type(KuduColumnSchema::INT32)->NotNull();
-  b.AddColumn("user_image_url")->Type(KuduColumnSchema::STRING)->NotNull();
-  CHECK_OK(b.Build(&s));
-  return s;
-}
-
-} // namespace twitter_demo
-} // namespace kudu
-#endif
-
-/*
-
-Schema for Impala:
-
-CREATE TABLE twitter (
-  tweet_id bigint,
-  text string,
-  source string,
-  created_at string,
-  user_id bigint,
-  user_name string,
-  user_description string,
-  user_location string,
-  user_followers_count int,
-  user_friends_count int,
-  user_image_url string);
-
-
-Schema for MySQL:
-
-CREATE TABLE twitter (
-  tweet_id bigint not null primary key,
-  tweet_text varchar(1000) not null,
-  source varchar(1000) not null,
-  created_at varchar(1000) not null,
-  user_id bigint not null,
-  user_name varchar(1000) not null,
-  user_description varchar(1000) not null,
-  user_location varchar(1000) not null,
-  user_followers_count int not null,
-  user_friends_count int not null,
-  user_image_url varchar(1000) not null);
-
-*/

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/twitter_streamer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/twitter_streamer.cc b/src/kudu/twitter-demo/twitter_streamer.cc
deleted file mode 100644
index b55ad22..0000000
--- a/src/kudu/twitter-demo/twitter_streamer.cc
+++ /dev/null
@@ -1,206 +0,0 @@
-// 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/twitter-demo/twitter_streamer.h"
-
-#include <cstdint>
-#include <cstring>
-#include <mutex>
-#include <ostream>
-#include <string>
-#include <thread>
-
-#include <curl/curl.h>
-#include <gflags/gflags.h>
-#include <glog/logging.h>
-
-#include "kudu/twitter-demo/oauth.h"
-#include "kudu/gutil/macros.h"
-#include "kudu/gutil/once.h"
-#include "kudu/util/slice.h"
-#include "kudu/util/status.h"
-
-using std::string;
-using std::thread;
-
-const char* kTwitterUrl = "https://stream.twitter.com/1.1/statuses/sample.json";
-
-// Defaults are for the "kudu-demo" app under the "KuduProject" account.
-// See https://dev.twitter.com/apps/4906821/oauth if you have credentials.
-DEFINE_string(twitter_consumer_key, "lRXXfnhNGhFO1DdAorVJeQ",
-              "Twitter API consumer key");
-DEFINE_string(twitter_consumer_secret, "5Enn1Uwy3mHdhwSVrJEbd24whGiHsA2YGJ0O28E",
-              "Twitter API consumer secret");
-DEFINE_string(twitter_token_key, "1653869436-7QncqwFkMaOS6rWNeHpwNQZ8li1CFbJp0QNOEpE",
-              "Twitter API access token key");
-DEFINE_string(twitter_token_secret, "1t3UPOJc6nkThvBPcCPGAj3gHB3mB97F3zraoRkKMA",
-              "Twitter API access token secret");
-
-namespace kudu {
-namespace twitter_demo {
-
-////////////////////////////////////////////////////////////
-// Curl utilities
-////////////////////////////////////////////////////////////
-
-static void DoInitCurl() {
-  CHECK_EQ(0, curl_global_init(CURL_GLOBAL_ALL));
-}
-
-static void InitCurl() {
-  static GoogleOnceType once = GOOGLE_ONCE_INIT;
-  GoogleOnceInit(&once, &DoInitCurl);
-}
-
-// Scope-based deleters for various libcurl types.
-template<class CurlType>
-class CurlDeleter {
- public:
-  explicit CurlDeleter(CurlType* curl) : curl_(curl) {}
-  ~CurlDeleter() {
-    if (curl_) DoFree();
-  }
- private:
-  // Will be specialized for each type.
-  void DoFree();
-  CurlType* curl_;
-
-  DISALLOW_COPY_AND_ASSIGN(CurlDeleter);
-};
-
-template<>
-void CurlDeleter<CURL>::DoFree() {
-  curl_easy_cleanup(curl_);
-}
-
-template<>
-void CurlDeleter<curl_slist>::DoFree() {
-  curl_slist_free_all(curl_);
-}
-
-////////////////////////////////////////////////////////////
-// TwitterStreamer implementation
-////////////////////////////////////////////////////////////
-
-Status TwitterStreamer::Init() {
-  if (FLAGS_twitter_consumer_key.empty()) {
-    return Status::InvalidArgument("Missing flag", "--twitter_consumer_key");
-  }
-  if (FLAGS_twitter_consumer_secret.empty()) {
-    return Status::InvalidArgument("Missing flag", "--twitter_consumer_secret");
-  }
-  if (FLAGS_twitter_token_key.empty()) {
-    return Status::InvalidArgument("Missing flag", "--twitter_token_key");
-  }
-  if (FLAGS_twitter_token_secret.empty()) {
-    return Status::InvalidArgument("Missing flag", "--twitter_token_secret");
-  }
-  return Status::OK();
-}
-
-Status TwitterStreamer::Start() {
-  CHECK(!thread_.joinable());
-
-  thread_ = thread(&TwitterStreamer::StreamThread, this);
-  return Status::OK();
-}
-
-Status TwitterStreamer::Join() {
-  thread_.join();
-  return stream_status_;
-}
-
-// C-style curl callback for data
-size_t DataReceivedCallback(void* buffer, size_t size, size_t nmemb, void* user_ptr) {
-  TwitterStreamer* streamer = DCHECK_NOTNULL(reinterpret_cast<TwitterStreamer*>(user_ptr));
-  size_t total_size = size * nmemb;
-  Slice data(reinterpret_cast<const uint8_t*>(buffer), total_size);
-  return streamer->DataReceived(data);
-}
-
-void TwitterStreamer::StreamThread() {
-  Status s = DoStreaming();
-  if (!s.ok()) {
-    LOG(ERROR) << "Streaming thread failed: " << s.ToString();
-    std::lock_guard<std::mutex> l(lock_);
-    stream_status_ = s;
-  }
-}
-
-Status TwitterStreamer::DoStreaming() {
-  OAuthRequest req("GET", kTwitterUrl);
-  req.AddStandardOAuthFields(FLAGS_twitter_consumer_key, FLAGS_twitter_token_key);
-  string auth_header = req.AuthHeader(FLAGS_twitter_consumer_secret, FLAGS_twitter_token_secret);
-  VLOG(1) << auth_header;
-
-  InitCurl();
-  CURL* curl = curl_easy_init();
-  CurlDeleter<CURL> delete_curl(curl);
-  if (!curl) {
-    return Status::NetworkError("curl_easy_init failed");
-  }
-  CHECK(curl);
-
-  // Disable SSL verification so we don't have to set up a
-  // trust store database of any kind.
-  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
-  curl_easy_setopt(curl, CURLOPT_URL, kTwitterUrl);
-  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, DataReceivedCallback);
-  curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
-
-  struct curl_slist* headers = NULL;
-  CurlDeleter<curl_slist> delete_headers(headers);
-  headers = curl_slist_append(headers, auth_header.c_str());
-
-  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
-
-  CURLcode res = curl_easy_perform(curl);
-  if (res != CURLE_OK) {
-    return Status::NetworkError("curl_easy_perfom failed", curl_easy_strerror(res));
-  }
-
-  return Status::OK();
-}
-
-size_t TwitterStreamer::DataReceived(const Slice& slice) {
-  recv_buf_.append(slice.data(), slice.size());
-
-  // Chop the received data into lines.
-  while (true) {
-    void* newline_ptr = memchr(recv_buf_.data(), '\n', recv_buf_.size());
-    if (newline_ptr == NULL) {
-      // no newlines
-      break;
-    }
-    int newline_idx = reinterpret_cast<uintptr_t>(newline_ptr) -
-      reinterpret_cast<uintptr_t>(recv_buf_.data());
-
-    Slice line(recv_buf_.data(), newline_idx);
-    consumer_->ConsumeJSON(line);
-
-    // Copy remaining data back to front of the buffer
-    int rem_size = recv_buf_.size() - newline_idx - 1;
-    memmove(recv_buf_.data(), &recv_buf_[newline_idx + 1], rem_size);
-    // Resize to only have the front
-    recv_buf_.resize(rem_size);
-  }
-
-  return slice.size();
-}
-
-} // namespace twitter_demo
-} // namespace kudu

http://git-wip-us.apache.org/repos/asf/kudu/blob/42ed9bd7/src/kudu/twitter-demo/twitter_streamer.h
----------------------------------------------------------------------
diff --git a/src/kudu/twitter-demo/twitter_streamer.h b/src/kudu/twitter-demo/twitter_streamer.h
deleted file mode 100644
index 37c1514..0000000
--- a/src/kudu/twitter-demo/twitter_streamer.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// 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.
-#ifndef KUDU_TWITTER_DEMO_TWITTER_STREAMER_H
-#define KUDU_TWITTER_DEMO_TWITTER_STREAMER_H
-
-#include <cstddef>
-#include <mutex>
-#include <thread>
-
-#include "kudu/gutil/macros.h"
-#include "kudu/util/faststring.h"
-#include "kudu/util/slice.h"
-#include "kudu/util/status.h"
-
-namespace kudu {
-namespace twitter_demo {
-
-class TwitterConsumer {
- public:
-  virtual void ConsumeJSON(const Slice& json) = 0;
-  virtual ~TwitterConsumer() {}
-};
-
-class TwitterStreamer {
- public:
-  explicit TwitterStreamer(TwitterConsumer* consumer)
-    : consumer_(consumer) {
-  }
-
-  Status Init();
-  Status Start();
-  Status Join();
-
- private:
-  friend size_t DataReceivedCallback(void* buffer, size_t size, size_t nmemb, void* user_ptr);
-  void StreamThread();
-  Status DoStreaming();
-  size_t DataReceived(const Slice& data);
-
-  std::thread thread_;
-  std::mutex lock_;
-  Status stream_status_;
-
-  faststring recv_buf_;
-
-  TwitterConsumer* consumer_;
-
-  DISALLOW_COPY_AND_ASSIGN(TwitterStreamer);
-};
-
-
-} // namespace twitter_demo
-} // namespace kudu
-#endif


Mime
View raw message