def execute(self, context, obj): if not obj['result']: return entry = obj['result'] num_entries = int(context['num_entries']) if not entry: return if num_entries >= 1000000: entry2 = TableTwo1M.get_by_key_name(entry.value) entry3 = TableOut1M(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put() elif num_entries >= 100000: entry2 = TableTwo100K.get_by_key_name(entry.value) entry3 = TableOut100K(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put() elif num_entries >= 10000: entry2 = TableTwo10K.get_by_key_name(entry.value) entry3 = TableOut10K(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put() elif num_entries >= 1000: entry2 = TableTwo1K.get_by_key_name(entry.value) entry3 = TableOut1K(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put() elif num_entries >= 100: entry2 = TableTwo100.get_by_key_name(entry.value) entry3 = TableOut100(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put()
def join_mapper(entry): if entry.__class__.__name__ == "TableOne1M": entry2 = TableTwo1M.get_by_key_name(entry.value) entry3 = TableOut1M(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put() if entry.__class__.__name__ == "TableOne100K": entry2 = TableTwo100K.get_by_key_name(entry.value) entry3 = TableOut100K(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put() if entry.__class__.__name__ == "TableOne10K": entry2 = TableTwo10K.get_by_key_name(entry.value) entry3 = TableOut10K(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put() if entry.__class__.__name__ == "TableOne1K": entry2 = TableTwo1K.get_by_key_name(entry.value) entry3 = TableOut1K(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put() if entry.__class__.__name__ == "TableOne100": entry2 = TableTwo100.get_by_key_name(entry.value) entry3 = TableOut100(key_name=entry.value, value1=entry.value, value2=entry2.value) entry3.put()
def getTable2Ent(num_entries, k): if num_entries >= 1000000: return TableTwo1M.get_by_key_name(k) if num_entries >= 100000: return TableTwo100K.get_by_key_name(k) if num_entries >= 10000: return TableTwo10K.get_by_key_name(k) if num_entries >= 1000: return TableTwo1K.get_by_key_name(k) if num_entries >= 100: return TableTwo100.get_by_key_name(k)