All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickzetta.platform.client.pool.RowPool Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.clickzetta.platform.client.pool;

import com.clickzetta.platform.client.api.Row;

public interface RowPool {

  enum Type {
    ARRAY,
    QUEUE,
  }

  interface Loader {
    Row load();
  }

  void initLoader(Loader loader);

  Row acquireRow();

  void releaseRow(Row row);

  class Builder {
    public static RowPool build(RowPool.Type type, int poolSize) {
      RowPool rowPool;
      switch (type) {
        case ARRAY:
          rowPool = new RowArrayPool(poolSize);
          break;
        case QUEUE:
          rowPool = new RowQueuePool(poolSize);
          break;
        default:
          throw new IllegalArgumentException(String.format("not support row pool type %s", type));
      }
      return rowPool;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy