~mysqlatfacebook/mysqlatfacebook/tools

« back to all changes in this revision

Viewing changes to prefetch/fake_updates_prefetch.py

  • Committer: Domas Mituzas
  • Date: 2011-12-03 19:55:54 UTC
  • Revision ID: domas@facebook.com-20111203195554-xvvgeq6gw01cs4yq
Replication prefetcher:
* binlog.py - binlog reading class
* readahead.py - main chassis for replication event prefetching
* mysql.py - helper MySQL class
* rewriters.py - helper query 'rewrite' routines
* custom_query_prefetch.py - example for query-specific prefetcher
* fake_updates_prefetch.py - InnoDB fake changes based prefetcher

Licensed under Apache License 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/local/bin/python2.6 -Wignore::DeprecationWarning
 
2
 
 
3
import readahead
 
4
import sys
 
5
from rewriters import fake_update
 
6
 
 
7
""" This prefetcher will be utilizing fake changes support
 
8
within InnoDB - so it can execute statements without much
 
9
rewriting. """
 
10
 
 
11
prefetch = readahead.Prefetch()
 
12
prefetch.worker_init_connect = "SET SESSION "\
 
13
    "long_query_time=60, innodb_fake_changes=1, sql_log_bin=0"
 
14
prefetch.rewriter = fake_update
 
15
prefetch.window_stop = 30
 
16
prefetch.runners = 16
 
17
 
 
18
if __name__ == "__main__":
 
19
    prefetch.run()