@@ -42,6 +42,7 @@ public class InvalidArgsException extends Exception {
4242 private String cassandraContactPoint ;
4343 private String host ;
4444 private CDMArgs args ;
45+ public String relative_schema_path = "schema.cql" ;
4546
4647
4748 CassandraDatasetManager () {
@@ -64,7 +65,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
6465
6566 System .out .println ("Starting CDM" );
6667 CDMArgs parsedArgs = new CDMArgs ();
67- new JCommander (parsedArgs , args );
68+ JCommander jc = new JCommander (parsedArgs , args );
6869
6970
7071 // check for the .cdm directory
@@ -97,6 +98,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
9798 // load schema using cqlsh - should this use a normal CSV loader eventually?
9899 if (args .length == 0 ) {
99100 cdm .printHelp ();
101+ jc .usage ();
100102 return ;
101103 }
102104
@@ -118,7 +120,8 @@ public static void main(String[] args) throws IOException, InterruptedException,
118120 cdm .update ();
119121 break ;
120122 default :
121- System .out .println ("Not sure what to do." );
123+ jc .usage ();
124+ cdm .printHelp ();
122125
123126 }
124127 System .out .println ("Finished." );
@@ -221,7 +224,6 @@ void install(String name) throws IOException, InterruptedException, GitAPIExcept
221224 // all the paths
222225 dataPath = path + "/data/" ;
223226 configLocation = path + "/cdm.yaml" ;
224- schema = path + "/schema.cql" ;
225227
226228 File configFile = new File (configLocation );
227229
@@ -230,6 +232,15 @@ void install(String name) throws IOException, InterruptedException, GitAPIExcept
230232 ObjectMapper mapper = new ObjectMapper (new YAMLFactory ());
231233
232234 Config config = mapper .readValue (configFile , Config .class );
235+
236+ if (config .schema != null ) {
237+ schema = path + "/" + config .schema ;
238+
239+ }
240+ else {
241+ schema = path + "/schema.cql" ;
242+ }
243+ System .out .println ("Loading schema from " + schema );
233244 String address = this .host ;
234245
235246 Cluster cluster = Cluster .builder ().addContactPoint (address ).build ();
0 commit comments