22 #ifndef Hypertable_Lib_HqlInterpreter_h
23 #define Hypertable_Lib_HqlInterpreter_h
60 Callback(
bool normal =
true) : output(0), normal_mode(normal),
61 format_ts_in_nanos(false), total_cells(0), total_keys_size(0),
62 total_values_size(0), file_size(0) { }
95 mutator->show_failed(e);
114 : cells(builder), retstrs(strs) { }
116 void on_return(
const std::string &ret)
override { retstrs.push_back(ret); }
123 bool immutable_namespace=
true);
126 int execute(
const std::string &
str, Callback &);
131 return execute(str, cb);
137 std::vector<String> res;
138 return execute(cmd, cb, res);
141 void set_namespace(
const std::string &ns);
157 #endif // Hypertable_Lib_HqlInterpreter_h
virtual void on_finish(TableMutatorPtr &mutator)
Called when interpreter is finished Note: mutator pointer maybe NULL in case of things like LOAD DATA...
uint64_t total_values_size
void on_return(const std::string &ret) override
Called when interpreter returns a string result Maybe called multiple times for a list of string resu...
ConnectionManagerPtr m_conn_manager
Po::typed_value< String > * str(String *v=0)
SmallCallback(CellsBuilder &builder, std::vector< String > &strs)
bool m_immutable_namespace
Callback(bool normal=true)
std::shared_ptr< TableScanner > TableScannerPtr
Smart pointer to TableScanner.
virtual void on_update(size_t total)
Called when interpreter is ready to update.
virtual void on_parsed(Hql::ParserState &)
Called when the hql string is parsed successfully.
std::shared_ptr< Namespace > NamespacePtr
Shared smart pointer to Namespace.
std::shared_ptr< TableMutator > TableMutatorPtr
Smart pointer to TableMutator.
virtual void on_progress(size_t amount)
Called when interpreter updates progress for long running queries.
The API of HQL interpreter.
std::shared_ptr< Client > ClientPtr
Smart pointer to Client.
void on_dump(TableDumper &dumper) override
Called when interpreter is ready to dump.
virtual void on_scan(TableScannerPtr &)
Called when interpreter is ready to scan.
virtual void on_dump(TableDumper &)
Called when interpreter is ready to dump.
Po::typed_value< Strings > * strs(Strings *v=0)
std::shared_ptr< HqlInterpreter > HqlInterpreterPtr
Smart pointer to HqlInterpreter.
void copy(TableDumper &, CellsBuilder &)
Callback interface/base class for execute.
virtual void on_finish(TableScannerPtr &scanner)
Called when scan is finished.
int execute(const std::string &cmd)
More convenient method for admin commands (create/drop table etc.)
Declarations for ConnectionManager.
virtual void on_return(const std::string &)
Called when interpreter returns a string result Maybe called multiple times for a list of string resu...
int execute(const std::string &str, CellsBuilder &output, std::vector< String > &ret)
A convenient method demonstrate the usage of the interface.
This is a generic exception class for Hypertable.
std::vector< String > & retstrs
std::shared_ptr< ConnectionManager > ConnectionManagerPtr
Smart pointer to ConnectionManager.
FsBroker::Lib::ClientPtr m_fs_client
An example for simple queries that returns small number of results.
void on_scan(TableScannerPtr &scanner) override
Called when interpreter is ready to scan.