private Map < String , Object > parsePersistClause ( String persistClause , Map < String , Object > persistDetails ) throws KunderaException { Pattern pattern = Pattern . compile ( "^([^.]+)\\.(?:([^.]+)\\.([^.]+)|\\[([^\\]]+)\\])$" ) ; Matcher matcher = pattern . matcher ( persistClause ) ; if ( matcher . find ( ) ) { persistDetails . put ( "client" , matcher . group ( 1 ) ) ; switch ( matcher . group ( 1 ) . toLowerCase ( ) ) { case SparkPropertiesConstants . CLIENT_CASSANDRA : persistDetails . put ( "keyspace" , matcher . group ( 2 ) ) ; persistDetails . put ( "table" , matcher . group ( 3 ) ) ; break ; case SparkPropertiesConstants . CLIENT_FS : persistDetails . put ( SparkPropertiesConstants . FS_OUTPUT_FILE_PATH , matcher . group ( 4 ) ) ; break ; case SparkPropertiesConstants . CLIENT_HDFS : persistDetails . put ( SparkPropertiesConstants . HDFS_OUTPUT_FILE_PATH , matcher . group ( 4 ) ) ; break ; case SparkPropertiesConstants . CLIENT_HIVE : persistDetails . put ( "keyspace" , matcher . group ( 2 ) ) ; persistDetails . put ( "table" , matcher . group ( 3 ) ) ; break ; default : throw new UnsupportedOperationException ( "Not Supported for this client" ) ; } } else { throw new KunderaException ( "Invalid Query" ) ; } return persistDetails ; }
Parses the persist clause .