gangliao-patch-1
gongweibao 8 years ago
parent 183a5d44ee
commit 4874810ba5

@ -113,7 +113,7 @@ func (c *Client) monitorMaster(addr Addresser) {
// //
// SetDataset can be call multiple times from different nodes. But // SetDataset can be call multiple times from different nodes. But
// only the first call will be honored. // only the first call will be honored.
func (c *Client) SetDataset(globPaths ...string) error { func (c *Client) SetDataset(globPaths []string) error {
return c.conn.Call("Service.SetDataset", globPaths, nil) return c.conn.Call("Service.SetDataset", globPaths, nil)
} }

@ -93,13 +93,17 @@ def recordio(paths, addr="", buf_size=100):
if len(os.environ["KUBERNETES_SERVICE_HOST"]) == 0: if len(os.environ["KUBERNETES_SERVICE_HOST"]) == 0:
return recordio_local(path) return recordio_local(path)
c = cloud(addr, buf_size) def reader():
c.set_dataset(paths) c = cloud(addr, buf_size)
c.set_dataset(paths)
while True:
r = client.next_record()
if r is None:
break
yield r
while True: c.close()
r = client.next_record()
if r is None: return reader
break
yield r
c.close()

Loading…
Cancel
Save