Guest User

Untitled

a guest
Jun 18th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. tba:elastic-mapreduce-cli$ s3cat [bucket.prefix]-test/testMapper.py
  2. #!/usr/bin/env python
  3.  
  4. if __name__ == "__main__":
  5. import sys
  6. sys.stderr.write("[DEBUG] in testMapper.py\n")
  7. sys.stderr.flush()
  8.  
  9. import os
  10. sys.stderr.write("files in .=%s\n" % os.listdir('.'))
  11. if os.path.isdir("./binaries"):
  12. sys.stderr.write("files in ./binaries=%s\n" % os.listdir('./binaries'))
  13. else:
  14. sys.stderr.write( "./binaries doesn't exist\n" )
  15. sys.stderr.flush()
  16.  
  17. sys.stderr.write("[DEBUG] trying to open ./binaries/pgn-extract\n")
  18. sys.stderr.flush()
  19. import subprocess
  20. from subprocess import PIPE
  21. pgnExtractProcess = subprocess.Popen( ('./binaries/pgn-extract', '-Wsanpnbrqk', '-Wlalg', '--nomovenumbers', '--notags', '-s', '-w99999999' ), stdin=PIPE, stdout=PIPE )
  22. sys.stderr.write("opened ./binaries/pgn-extract\n")
  23. sys.stderr.flush()
  24.  
  25. for line in sys.stdin:
  26. print "LongValueSum: got line\t1"
  27.  
  28. tba:elastic-mapreduce-cli$ s3cat [bucket.prefix]-test/data_smaller.tsv | head -2
  29. e4 c5 Nf3 e6 b4 cxb4 d4 Nf6 Bd3 b6 Qe2 Bb7 O-O Be7 Nbd2 Nc6 Re1 Rc8 h4 Na5 Qe3 O-O Qf4 Qc7 Ne5 Qc3 Rb1 Qxd4 Bb2 Qc5 Re3 d6 Nd7 Nxd7 Bxg7 Kxg7Rg3+ Kh8 Qh6 Qe5 Nf3 Qf6 Qh5 Ne5 Ng5 Qg6 Qe2 Bxg5 Rxg5 Qf6 f4 Nxd3 Qxd3 Rc3 Qxd6 Rd8 Qxb4 Qd4+ Qxd4+ Rxd4 0-1
  30. d4 Nf6 c4 e6 Nf3 d5 e3 Bb4+ Bd2 Be7 Nc3 O-O Bd3 b6 Qe2 c5 dxc5 dxc4Bxc4 Bxc5 Rd1 Bb7 a3 Qc8 O-O Nbd7 e4 Be7 Bg5 h6 Bh4 Re8 Bb5 Bc6 Rc1 Bxb5Nxb5 Qa6 e5 Nd5 Bxe7 Rxe7 Nfd4 Nf8 Qe4 Rc8 h4 Rc5 Nd6 Rec7 Rcd1 Re7 Rd3 Ng6 Rf3 Nf8 Rg3 Rec7 Ne8 g6 Nxc7 Rxc7 h5 Kh7 hxg6+ Nxg6 Nxe6 Qc4 Nf8+ Kg8 Qxc4 Rxc4Nxg6 fxg6 Rxg6+ Kh7 Rd6 Nf4 g3 Nh3+ Kg2 Ng5 Re1 h5 e6 Rc8 e7 Re8 1-0
  31. tba:elastic-mapreduce-cli$ s3get [bucket.prefix]-test
  32. +---------------+--------+--------+---------+-------------+------------------+--------------------------+--------+--------------+
  33. | Name | Prefix | Marker | MaxKeys | IsTruncated | Key | LastModified | Size | StorageClass |
  34. +---------------+--------+--------+---------+-------------+------------------+--------------------------+--------+--------------+
  35. | [bucket.prefix]-test | | | 1000 | false | | | | |
  36. | | | | | | binaries.tar | 2012-02-07T08:17:52.000Z | 317440 | STANDARD |
  37. | | | | | | data_smaller.tsv | 2012-02-07T08:17:51.000Z | 364124 | STANDARD |
  38. | | | | | | testMapper.py | 2012-02-07T08:56:28.000Z | 574 | STANDARD |
  39. +---------------+--------+--------+---------+-------------+------------------+--------------------------+--------+--------------+
  40. tba:elastic-mapreduce-cli$ ./elastic-mapreduce --create --stream \
  41. > --mapper s3n://[bucket.prefix]-test/testMapper.py \
  42. > --input s3n://[bucket.prefix]-test/data_smaller.tsv \
  43. > --output s3n://[bucket.prefix]-test/output \
  44. > –-cache-archive "s3n://[bucket.prefix]-test/binaries.tar#binaries" \
  45. > --reducer aggregate
  46.  
  47. Created job flow j-2NDZ4ENOG0S79
  48. tba:elastic-mapreduce-cli$
Add Comment
Please, Sign In to add comment