Skip to content

Instantly share code, notes, and snippets.

@TkrUdagawa
Created October 11, 2016 08:16
Show Gist options
  • Save TkrUdagawa/06799b1db0adb45c1969838bd9721bdb to your computer and use it in GitHub Desktop.
Save TkrUdagawa/06799b1db0adb45c1969838bd9721bdb to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from jubatus.recommender.client import Recommender
from jubatus.common import Datum
interval_count = 512
if __name__ == '__main__':
cli = Recommender("127.0.0.1", 9199, "my-cluster")
print("update_row")
for i in range(interval_count - 1):
cli.update_row("foo", Datum({"key-" + str(i): i}))
cli.update_row("hoge", Datum({"key-" + str(i): i}))
print("clear_row")
cli.clear_row("foo") # this update request triggers MIX
print("waiting for MIX to complete...")
time.sleep(3)
print("get_all_rows")
print(cli.get_all_rows())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment