@@ -232,12 +232,14 @@ public boolean ping() throws Exception
232
232
}
233
233
234
234
/**
235
- * Creates the HPCC file.
235
+ * @deprecated Due to change in server behavior
236
+ * Use boolean createHPCCFile(String fileName, String targetLandingZone, boolean overwritefile, String lzAddress) instead
237
+ * Creates an HPCC file.
236
238
*
237
239
* @param fileName
238
240
* - The target HPCC file name
239
241
* @param targetLandingZone
240
- * - The "netaddress" of the target landing, can be localhost, should be fetched from landingzones in filesprayclient
242
+ * - The LZ name, no longer the netaddress of the LZ. should be fetched from landingzones in filesprayclient
241
243
* @param overwritefile
242
244
* - If the file exists, should it be overwritten?
243
245
* @return true, if successful
@@ -247,17 +249,47 @@ public boolean ping() throws Exception
247
249
* the array of esp exception wrapper
248
250
*/
249
251
public boolean createHPCCFile (String fileName , String targetLandingZone , boolean overwritefile ) throws Exception , ArrayOfEspExceptionWrapper
252
+ {
253
+ return createHPCCFile (fileName , targetLandingZone , overwritefile , null );
254
+ }
255
+
256
+ /**
257
+ * Creates an HPCC file.
258
+ *
259
+ * @param fileName
260
+ * - The target HPCC file name
261
+ * @param targetLandingZone
262
+ * - The LZ name, no longer the netaddress of the LZ. should be fetched from landingzones in filesprayclient
263
+ * @param overwritefile
264
+ * - If the file exists, should it be overwritten?
265
+ * @param lzAddress
266
+ * - The Landing zone address
267
+ * @return true, if successful
268
+ * @throws java.lang.Exception
269
+ * - Caller should handle exception in case of errors
270
+ * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper
271
+ * the array of esp exception wrapper
272
+ */
273
+ public boolean createHPCCFile (String fileName , String targetLandingZone , boolean overwritefile , String lzAddress ) throws Exception , ArrayOfEspExceptionWrapper
250
274
{
251
275
boolean success = false ;
252
276
log .debug ("Attempting to create HPCC File: " + fileName );
253
277
278
+ if (targetLandingZone == null || targetLandingZone .isEmpty ())
279
+ throw new Exception ("HPCCWsFileIOClient::createHPCCFile: targetLandingZone required!" );
280
+
281
+ if (fileName == null || fileName .isEmpty ())
282
+ throw new Exception ("HPCCWsFileIOClient::createHPCCFile: fileName required!" );
283
+
254
284
verifyStub (); // Throws exception if stub failed
255
285
256
286
CreateFileRequest request = new CreateFileRequest ();
257
287
258
288
request .setDestDropZone (targetLandingZone );
259
289
request .setDestRelativePath (fileName );
260
290
request .setOverwrite (overwritefile );
291
+ if (lzAddress != null && !lzAddress .isEmpty ())
292
+ request .setDestNetAddress (lzAddress );
261
293
262
294
CreateFileResponse resp = null ;
263
295
try
@@ -298,13 +330,15 @@ public boolean createHPCCFile(String fileName, String targetLandingZone, boolean
298
330
* - At what offset should this be written - Specify 0 if necessary
299
331
* @param uploadchunksize
300
332
* - Chunksize to upload the data
333
+ * @param lzAddress
334
+ * - The Landing zone address
301
335
* @return true, if successful
302
336
* @throws java.lang.Exception
303
337
* the exception
304
338
* @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper
305
339
* the array of esp exception wrapper
306
340
*/
307
- public boolean writeHPCCFileData (byte [] data , String fileName , String targetLandingZone , boolean append , long offset , int uploadchunksize )
341
+ public boolean writeHPCCFileData (byte [] data , String fileName , String targetLandingZone , boolean append , long offset , int uploadchunksize , String lzAddress )
308
342
throws Exception , ArrayOfEspExceptionWrapper
309
343
{
310
344
boolean success = true ;
@@ -318,6 +352,8 @@ public boolean writeHPCCFileData(byte[] data, String fileName, String targetLand
318
352
request .setDestDropZone (targetLandingZone );
319
353
request .setDestRelativePath (fileName );
320
354
request .setOffset (offset );
355
+ if (lzAddress != null && !lzAddress .isEmpty ())
356
+ request .setDestNetAddress (lzAddress );
321
357
322
358
int dataindex = 0 ;
323
359
int limit = uploadchunksize <= 0 ? defaultUploadChunkSize : uploadchunksize ;
@@ -368,6 +404,35 @@ public boolean writeHPCCFileData(byte[] data, String fileName, String targetLand
368
404
return success ;
369
405
}
370
406
407
+ /**
408
+ * @deprecated Due to change in server behavior
409
+ * Use boolean writeHPCCFileData(byte[] data, String fileName, String targetLandingZone, boolean append, long offset, int uploadchunksize, String lzAddress) instead
410
+ * Write HPCC file data.
411
+ *
412
+ * @param data
413
+ * - The data to write
414
+ * @param fileName
415
+ * - The target HPCC file to write to
416
+ * @param targetLandingZone
417
+ * - The "netaddress" of the target landing, can be localhost, should be fetched from landingzones in filesprayclient
418
+ * @param append
419
+ * - Should this data be appended?
420
+ * @param offset
421
+ * - At what offset should this be written - Specify 0 if necessary
422
+ * @param uploadchunksize
423
+ * - Chunksize to upload the data
424
+ * @return true, if successful
425
+ * @throws java.lang.Exception
426
+ * the exception
427
+ * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper
428
+ * the array of esp exception wrapper
429
+ */
430
+ public boolean writeHPCCFileData (byte [] data , String fileName , String targetLandingZone , boolean append , long offset , int uploadchunksize )
431
+ throws Exception , ArrayOfEspExceptionWrapper
432
+ {
433
+ return writeHPCCFileData (data , fileName , targetLandingZone , append , offset , uploadchunksize , null );
434
+ }
435
+
371
436
/**
372
437
* Read file data.
373
438
*
@@ -379,19 +444,23 @@ public boolean writeHPCCFileData(byte[] data, String fileName, String targetLand
379
444
* the datasize
380
445
* @param offset
381
446
* the offset
447
+ * @param dropzoneAddress
448
+ * the dropzone address (not needed in containerized mode)
382
449
* @return the string
383
450
* @throws java.lang.Exception
384
451
* the exception
385
452
* @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper
386
453
* the array of esp exception wrapper
387
454
*/
388
- public String readFileData (String dropzone , String fileName , long datasize , long offset ) throws Exception , ArrayOfEspExceptionWrapper
455
+ public String readFileData (String dropzone , String fileName , long datasize , long offset , String dropzoneAddress ) throws Exception , ArrayOfEspExceptionWrapper
389
456
{
390
457
ReadFileDataRequest readFileDataRequest = new ReadFileDataRequest ();
391
458
readFileDataRequest .setDestDropZone (dropzone );
392
459
readFileDataRequest .setDestRelativePath (fileName );
393
460
readFileDataRequest .setDataSize (datasize );
394
461
readFileDataRequest .setOffset (offset );
462
+ if (dropzoneAddress != null && !dropzoneAddress .isEmpty ())
463
+ readFileDataRequest .setDestNetAddress (dropzoneAddress );
395
464
396
465
ReadFileDataResponse resp = null ;
397
466
try
@@ -426,4 +495,28 @@ public String readFileData(String dropzone, String fileName, long datasize, long
426
495
427
496
return data ;
428
497
}
498
+
499
+ /**
500
+ * @deprecated Due to change in server behavior
501
+ * Use String readFileData(String dropzone, String fileName, long datasize, long offset, String dropzoneAddress) instead
502
+ * Read file data.
503
+ *
504
+ * @param dropzone
505
+ * the dropzone
506
+ * @param fileName
507
+ * the file name
508
+ * @param datasize
509
+ * the datasize
510
+ * @param offset
511
+ * the offset
512
+ * @return the string
513
+ * @throws java.lang.Exception
514
+ * the exception
515
+ * @throws org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper
516
+ * the array of esp exception wrapper
517
+ */
518
+ public String readFileData (String dropzone , String fileName , long datasize , long offset ) throws Exception , ArrayOfEspExceptionWrapper
519
+ {
520
+ return readFileData (dropzone , fileName , datasize , offset , null );
521
+ }
429
522
}
0 commit comments