public void init()

in griddb/src/main/java/site/ycsb/db/griddb/GridDBClient.java [92:175]


  public void init() throws DBException {
    LOGGER.info("GridDBClient");

    final Properties props = getProperties();
    notificationAddress = props.getProperty("notificationAddress");
    notificationPort = props.getProperty("notificationPort");
    notificationMember = props.getProperty("notificationMember");
    clusterName = props.getProperty("clusterName");
    userName = props.getProperty("userName");
    password = props.getProperty("password");
    containerPrefix = props.getProperty("table", "usertable") + "@";
    String fieldcount = props.getProperty("fieldcount");
    String fieldlength = props.getProperty("fieldlength");

    LOGGER.info("notificationAddress=" + notificationAddress + " notificationPort=" + notificationPort +
            " notificationMember=" + notificationMember);
    LOGGER.info("clusterName=" + clusterName + " userName=" + userName);
    LOGGER.info("fieldcount=" + fieldcount + " fieldlength=" + fieldlength);


    final Properties gridstoreProp = new Properties();
    if (clusterName == null || userName == null || password == null) {
      LOGGER.severe("[ERROR] clusterName or userName or password argument not specified");
      throw new DBException();
    }
    if (fieldcount == null || fieldlength == null) {
      LOGGER.severe("[ERROR] fieldcount or fieldlength argument not specified");
      throw new DBException();
    } else {
      if (!fieldcount.equals(String.valueOf(FIELD_NUM)) || !fieldlength.equals("100")) {
        LOGGER.severe("[ERROR] Invalid argment: fieldcount or fieldlength");
        throw new DBException();
      }
    }
    if (notificationAddress != null) {
      if (notificationPort == null) {
        LOGGER.severe("[ERROR] notificationPort argument not specified");
        throw new DBException();
      }
      //(A)multicast method
      gridstoreProp.setProperty("notificationAddress", notificationAddress);
      gridstoreProp.setProperty("notificationPort", notificationPort);
    } else if (notificationMember != null) {
      //(B)fixed list method
      gridstoreProp.setProperty("notificationMember", notificationMember);
    } else {
      LOGGER.severe("[ERROR] notificationAddress and notificationMember argument not specified");
      throw new DBException();
    }
    gridstoreProp.setProperty("clusterName", clusterName);
    gridstoreProp.setProperty("user", userName);
    gridstoreProp.setProperty("password", password);

    gridstoreProp.setProperty("containerCacheSize", String.valueOf(DEFAULT_CACHE_CONTAINER_NUM));

    List<ColumnInfo> columnInfoList = new ArrayList<ColumnInfo>();
    ColumnInfo keyInfo = new ColumnInfo("key", SCHEMA_TYPE);
    columnInfoList.add(keyInfo);
    for (int i = 0; i < FIELD_NUM; i++) {
      String columnName = String.format(VALUE_COLUMN_NAME_PREFIX + "%d", i);
      ColumnInfo info = new ColumnInfo(columnName, SCHEMA_TYPE);
      columnInfoList.add(info);
    }
    containerInfo = new ContainerInfo(null, ContainerType.COLLECTION, columnInfoList, true);

    try {
      GridStoreFactory.getInstance().setProperties(gridstoreProp);
      store = GridStoreFactory.getInstance().getGridStore(gridstoreProp);
      PartitionController controller = store.getPartitionController();
      numContainer = controller.getPartitionCount();

      for(int k = 0; k < numContainer; k++) {
        String name = containerPrefix + k;
        store.putContainer(name, containerInfo, false);
      }
    } catch (GSException e) {
      LOGGER.severe("Exception: " + e.getMessage());
      throw new DBException();
    }

    LOGGER.info("numContainer=" + numContainer + " containerCasheSize=" + 
            String.valueOf(DEFAULT_CACHE_CONTAINER_NUM));

  }