ハイパーテーブルのサンプルコードを見つけることができる場所、またはc ++を使用してハイパーテーブルのサンプルを投稿できる場所
1077 次
3 に答える
1
于 2011-02-19T08:15:38.153 に答える
0
これを参照してください:: http://blog.hypertable.com/ ハイパーテーブル プロジェクトをダウンロードします:: http://www.hypertable.org/
于 2011-02-19T08:16:04.340 に答える
0
#ifndef BOOST_FOREACH
#define BOOST_FOREACH 0
#endif
#include "Common/Compat.h"
#include "Common/System.h"
#include <arpa/inet.h>
#include <iostream>
#include <fstream>
#include "ThriftBroker/Client.h"
#include "ThriftBroker/gen-cpp/HqlService.h"
#include "ThriftBroker/ThriftHelper.h"
#include "ThriftBroker/SerializedCellsReader.h"
using namespace Hypertable;
using namespace Hypertable::ThriftGen;
int main (int argc, char **argv)
{
Thrift::Client *client = new Thrift::Client("localhost", 38080);
if (!client->namespace_exists("/"))
{
delete client;
return 0;
}
Namespace ns = client->namespace_open("/");
HqlResult result;
client->hql_query(result, ns, "select * from foo");
std::cout << result << std::endl;
client->namespace_close(ns);
delete client;
return 0;
}
これと、/opt/hypertable/current/include/ThriftBroker/gen-cpp 文書を以下に追加します。
于 2013-09-16T02:27:03.977 に答える