public void setOption ( String optionName , String optionValue ) { // Ensure option value is not empty and trim excess whitespace. Utils . require ( optionName != null , "optionName" ) ; Utils . require ( optionValue != null && optionValue . trim ( ) . length ( ) > 0 , "Value for option '" + optionName + "' can not be empty" ) ; optionValue = optionValue . trim ( ) ; m_optionMap . put ( optionName . toLowerCase ( ) , optionValue ) ; // sharding-granularity and sharding-start are validated here since we must set // local members when the table's definition is parsed. if ( optionName . equalsIgnoreCase ( CommonDefs . OPT_SHARDING_GRANULARITY ) ) { m_shardingGranularity = ShardingGranularity . fromString ( optionValue ) ; Utils . require ( m_shardingGranularity != null , "Unrecognized 'sharding-granularity' value: " + optionValue ) ; } else if ( optionName . equalsIgnoreCase ( CommonDefs . OPT_SHARDING_START ) ) { Utils . require ( isValidShardDate ( optionValue ) , "'sharding-start' must be YYYY-MM-DD: " + optionValue ) ; m_shardingStartDate = new GregorianCalendar ( Utils . UTC_TIMEZONE ) ; m_shardingStartDate . setTime ( Utils . dateFromString ( optionValue ) ) ; } }
Set the option with the given name to the given value . This method does not validate that the given option name and value are valid since options are storage service - specific .