View Javadoc

1   package org.archive.io.hbase;
2   
3   import java.io.IOException;
4   import java.util.concurrent.atomic.AtomicInteger;
5   
6   import org.archive.io.WriterPool;
7   import org.archive.io.WriterPoolMember;
8   import org.archive.io.WriterPoolSettings;
9   
10  // TODO: Auto-generated Javadoc
11  /**
12   * The Class HBaseWriterPool.
13   */
14  public class HBaseWriterPool extends WriterPool {
15  
16  	/** The _parameters. */
17  	private HBaseParameters _parameters;
18  
19  	/**
20  	 * Instantiates a new h base writer pool.
21  	 *
22  	 * @param serial the serial
23  	 * @param settings the settings
24  	 * @param poolMaximumActive the pool maximum active
25  	 * @param poolMaximumWait the pool maximum wait
26  	 * @param parameters the parameters
27  	 */
28  	public HBaseWriterPool(AtomicInteger serial, WriterPoolSettings settings, int poolMaximumActive, int poolMaximumWait, HBaseParameters parameters) {
29  
30  		super(serial, settings, poolMaximumActive, poolMaximumWait);
31  
32  		_parameters = parameters;
33  	}
34  
35  	/* (non-Javadoc)
36  	 * @see org.archive.io.WriterPool#makeWriter()
37  	 */
38  	@Override
39  	protected WriterPoolMember makeWriter() {
40  		try {
41  			return new HBaseWriter(getSerialNo(), getSettings(), _parameters);
42  		} catch (IOException e) {
43  			throw new RuntimeException("Couldn't create a " + HBaseWriter.class.getName() + " writer object");
44  		}
45  	}
46  
47  }