class IoTDBConfigDynamicAdapter implements IDynamicAdapter {

  @Override
  public void addOrDeleteTimeSeries(int diff) throws ConfigAdjusterException {
    if (!CONFIG.isEnableParameterAdapter()) {
      return;
    }
    totalTimeseries += diff;
    staticMemory += diff * TIMESERIES_METADATA_SIZE_IN_BYTE;
    if (!tryToAdaptParameters()) {
      totalTimeseries -= diff;
      staticMemory -= diff * TIMESERIES_METADATA_SIZE_IN_BYTE;
      throw new ConfigAdjusterException(ADD_TIMESERIES);
    }
  }

  private  IoTDBConfigDynamicAdapter();

}