Integrates new state store into internal endpoint.

pull/1291/head
James Phillips 2015-10-12 20:48:50 -07:00
parent 0959b87548
commit c83a9e043a
1 changed files with 20 additions and 8 deletions

View File

@ -22,12 +22,18 @@ func (m *Internal) NodeInfo(args *structs.NodeSpecificRequest,
} }
// Get the node info // Get the node info
state := m.srv.fsm.State() state := m.srv.fsm.StateNew()
return m.srv.blockingRPC(&args.QueryOptions, return m.srv.blockingRPCNew(
&args.QueryOptions,
&reply.QueryMeta, &reply.QueryMeta,
state.QueryTables("NodeInfo"), state.GetQueryWatch("NodeInfo"),
func() error { func() error {
reply.Index, reply.Dump = state.NodeInfo(args.Node) index, dump, err := state.NodeInfo(args.Node)
if err != nil {
return err
}
reply.Index, reply.Dump = index, dump
return m.srv.filterACL(args.Token, reply) return m.srv.filterACL(args.Token, reply)
}) })
} }
@ -40,12 +46,18 @@ func (m *Internal) NodeDump(args *structs.DCSpecificRequest,
} }
// Get all the node info // Get all the node info
state := m.srv.fsm.State() state := m.srv.fsm.StateNew()
return m.srv.blockingRPC(&args.QueryOptions, return m.srv.blockingRPCNew(
&args.QueryOptions,
&reply.QueryMeta, &reply.QueryMeta,
state.QueryTables("NodeDump"), state.GetQueryWatch("NodeDump"),
func() error { func() error {
reply.Index, reply.Dump = state.NodeDump() index, dump, err := state.NodeDump()
if err != nil {
return err
}
reply.Index, reply.Dump = index, dump
return m.srv.filterACL(args.Token, reply) return m.srv.filterACL(args.Token, reply)
}) })
} }