我在哪里可以找到一个超级样本代码,或者任何人都可以用c ++发布一个样本用于超文本
答案 0 :(得分:1)
答案 1 :(得分:0)
看到这个:: http://blog.hypertable.com/ 并下载超级项目:: http://www.hypertable.org/
答案 2 :(得分: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;
}
将其和/选择/ Hypertable的/当前/包含/ ThriftBroker / GEN-CPP文件夹下的 Client_constants.cpp,Client_types.cpp,ClientService.cpp,Hql_constants.cpp,Hql_types.cpp,HqlService.cpp一起编译