public Optional < MesosFileChunkObject > readSandBoxFile ( String taskId , String path , Optional < String > grep , Optional < Long > offset , Optional < Long > length ) { final Function < String , String > requestUrl = ( host ) - > String . format ( SANDBOX_READ_FILE_FORMAT , getApiBase ( host ) , taskId ) ; Builder < String , Object > queryParamBuider = ImmutableMap . < String , Object > builder ( ) . put ( "path" , path ) ; if ( grep . isPresent ( ) ) { queryParamBuider . put ( "grep" , grep . get ( ) ) ; } if ( offset . isPresent ( ) ) { queryParamBuider . put ( "offset" , offset . get ( ) ) ; } if ( length . isPresent ( ) ) { queryParamBuider . put ( "length" , length . get ( ) ) ; } return getSingleWithParams ( requestUrl , "Read sandbox file for task" , taskId , Optional . of ( queryParamBuider . build ( ) ) , MesosFileChunkObject . class ) ; }
Retrieve part of the contents of a file in a specific task s sandbox .