29 #ifndef Hypertable_Master_OperationProcessor_h
30 #define Hypertable_Master_OperationProcessor_h
40 #include <boost/graph/adjacency_list.hpp>
41 #include <boost/graph/properties.hpp>
42 #include <boost/thread/condition.hpp>
45 #include <condition_variable>
51 #include <unordered_map>
86 typedef boost::vertex_property_tag
kind;
90 typedef boost::vertex_property_tag
kind;
94 typedef boost::vertex_property_tag
kind;
98 typedef boost::vertex_property_tag
kind;
102 typedef boost::edge_property_tag
kind;
105 typedef boost::adjacency_list<
106 boost::listS, boost::listS, boost::bidirectionalS,
107 boost::property<boost::vertex_index_t, std::size_t,
111 boost::property<busy_t, bool> > > > >,
112 boost::property<permanent_t, bool> >
117 typedef GraphTraits::vertex_descriptor
Vertex;
118 typedef GraphTraits::edge_descriptor
Edge;
175 operation(op),
vertex(v) { }
209 boost::property_map<OperationGraph, execution_time_t>::type
exec_time;
210 boost::property_map<OperationGraph, operation_t>::type
ops;
211 boost::property_map<OperationGraph, label_t>::type
label;
212 boost::property_map<OperationGraph, busy_t>::type
busy;
213 boost::property_map<OperationGraph, permanent_t>::type
permanent;
251 #endif // Hypertable_Master_OperationProcessor_h
std::set< String > StringSet
STL Set managing Strings.
ContextPtr & master_context
vertex_info(Vertex v, bool t)
void update_operation(Vertex v, OperationPtr &operation)
Updates dependency relationship of an operation.
std::string String
A String is simply a typedef to std::string.
ExecutionList::iterator current_iter
std::unordered_map< int64_t, OperationVertex > operation_hash
ThreadContext & m_context
void graphviz_output(String &output)
Declarations for Operation.
Program options handling.
boost::vertex_property_tag kind
void activate(const String &name)
void add_obstruction(Vertex v, const String &name)
void add_exclusivity(Vertex v, const String &name)
void recompute_order()
Recomputes operation execution order.
void unblock(const String &name)
boost::property_map< OperationGraph, operation_t >::type ops
std::condition_variable idle_cond
void state_description(String &output)
std::multimap< const String, Vertex > DependencyIndex
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
void retire_operation(Vertex v, OperationPtr &operation)
Retires (remove) an operation.
boost::property_map< OperationGraph, execution_time_t >::type exec_time
PerpetualSet perpetual_ops
void add_edge(Vertex v, Vertex u)
boost::vertex_property_tag kind
OperationVertex(OperationPtr &op, Vertex &v)
boost::property_map< OperationGraph, label_t >::type label
ltvertexinfo(ThreadContext &context)
boost::property_map< OperationGraph, busy_t >::type busy
GraphTraits::vertex_descriptor Vertex
std::list< vertex_info > ExecutionList
boost::thread_group ThreadGroup
bool need_order_recompute
not_permanent(ThreadContext &context)
boost::property_map< OperationGraph, permanent_t >::type permanent
boost::vertex_property_tag kind
ThreadContext(ContextPtr &mctx)
void add_edge_permanent(Vertex v, Vertex u)
std::unique_ptr< std::ofstream > m_graphviz_out
Importing boost::thread and boost::thread_group into the Hypertable namespace.
std::set< Vertex > VertexSet
Manages the sending of operation results back to clients.
ExecutionList execution_order
void purge_from_dependency_index(Vertex v)
void add_operation(OperationPtr operation)
boost::adjacency_list< boost::listS, boost::listS, boost::bidirectionalS, boost::property< boost::vertex_index_t, std::size_t, boost::property< operation_t, OperationPtr, boost::property< execution_time_t, int, boost::property< label_t, String, boost::property< busy_t, bool > > > > >, boost::property< permanent_t, bool > > OperationGraph
std::condition_variable cond
DependencyIndex dependency_index
DependencyIndex exclusivity_index
boost::edge_property_tag kind
void add_operations(std::vector< OperationPtr > &operations)
void add_dependencies(Vertex v, OperationPtr &operation)
OperationPtr remove_operation(int64_t hash_code)
std::set< OperationPtr > PerpetualSet
bool operator()(const Edge &e) const
OperationProcessor(ContextPtr &context, size_t thread_count)
void add_dependency(Vertex v, const String &name)
Runs a set of operaions with dependency relationships.
boost::vertex_property_tag kind
ThreadContext & m_context
void add_operation_internal(OperationPtr &operation)
DependencyIndex obstruction_index
ExecutionList::iterator execution_order_iter
bool load_current()
Loads m_context.current list with operations to be executed.
std::set< int64_t > op_ids
boost::graph_traits< OperationGraph > GraphTraits
Worker(ThreadContext &context)
ResponseManager * response_manager
std::shared_ptr< Operation > OperationPtr
Smart pointer to Operation.
String extensions and helpers: sets, maps, append operators etc.
Declarations for Context.
ThreadContext & m_context
bool operator()(const vertex_info &vi1, const vertex_info &vi2)
Declarations for ResponseManager.
void purge_from_exclusivity_index(Vertex v)
void purge_from_obstruction_index(Vertex v)
GraphTraits::edge_descriptor Edge