This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Created on 2011-04-23 | |
@author: Bohdan Mushkevych | |
@author: Aaron Westendorf | |
""" | |
import functools | |
import time | |
from pymongo.errors import AutoReconnect | |
from pymongo.connection import Connection as MongoConnection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Created on 2011-02-10 | |
@author: Bohdan Mushkevych | |
@author: Brian Curtin | |
http://code.activestate.com/lists/python-ideas/8982/ | |
""" | |
from datetime import datetime | |
import threading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.reinvent.synergy.data.csvimport; | |
import com.reinvent.synergy.data.model.Constants; | |
import com.reinvent.synergy.data.model.UserLog; | |
import com.reinvent.synergy.data.system.PoolManager; | |
import com.reinvent.synergy.data.system.TableContext; | |
import com.reinvent.synergy.data.system.TimePeriodHelper; | |
import org.apache.log4j.Logger; | |
import org.apache.log4j.PropertyConfigurator; | |
import org.supercsv.io.CsvMapReader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Bohdan Mushkevych | |
* date: 16 Mar 2012 | |
* Description: presents OutOfMemoryError recovery in Hadoop | |
*/ | |
public class ExemplaryMapper extends Mapper<ImmutableBytesWritable, Result, ImmutableBytesWritable, ImmutableBytesWritable> { | |
private static Logger log = Logger.getLogger(ExemplaryMapper.class); | |
@Override | |
protected void map(ImmutableBytesWritable key, Result result, Context context) throws IOException, InterruptedException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.log4j.Logger; | |
import org.rosuda.JRI.REXP; | |
import org.rosuda.JRI.RMainLoopCallbacks; | |
import org.rosuda.JRI.Rengine; | |
import java.util.*; | |
/** | |
* @author Bohdan Mushkevych | |
* date Apr 2012 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.hbase.client.Put; | |
import org.apache.hadoop.hbase.client.Result; | |
import org.apache.hadoop.hbase.io.ImmutableBytesWritable; | |
import org.apache.hadoop.io.Writable; | |
import org.apache.log4j.Logger; | |
import org.rosuda.JRI.REXP; | |
import org.rosuda.JRI.RMainLoopCallbacks; | |
import org.rosuda.JRI.Rengine; | |
import java.io.IOException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.log4j.Logger; | |
import org.apache.mahout.math.Varint; | |
import java.io.*; | |
/** | |
* @author Bohdan Mushkevych | |
* Description: module presents tuple of two int values: alpha and beta | |
*/ | |
class Tuple2I { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MBeanExample(object): | |
def __init__(self): | |
self.property_1 = 'this is' | |
self.property_2 = 'example' | |
def start_mx(self): | |
""" import MX module (which has back-reference import to self) and start it """ | |
from mx.mx import MX | |
self.mx = MX(self) | |
self.mx.start_mx_thread() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Example { | |
@HRowKey | |
public byte[] key; | |
@HProperty(family = "stat", identifier = "number_of_users") | |
public long numberOfUsers; | |
@HMapProperty(family = "stat", identifier = "months", keyType = String.class, valueType = Integer.class) | |
public Map<String, Integer> months = new HashMap<String, Integer>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Grouping { | |
@HRowKey(components = { | |
@HFieldComponent(name = Constants.TIMEPERIOD, length = Bytes.SIZEOF_INT, type = Integer.class), | |
@HFieldComponent(name = Constants.CATEGORY, length = Constants.LENGTH_CATEGORY_NAME, type = String.class) | |
}) | |
public byte[] key; | |
/** | |
* format of the storage: | |
* {product_id : { |
OlderNewer