@Test public void testMkdir() throws Exception { String folderName = "my-test-folder"; _s3PinotFS.mkdir(URI.create(String.format(FILE_FORMAT, SCHEME, BUCKET, folderName))); HeadObjectResponse headObjectResponse = _s3Client.headObject(S3TestUtils.getHeadObjectRequest(BUCKET, folderName)); Assert.assertTrue(headObjectResponse.sdkHttpResponse().isSuccessful()); }
@Override public boolean mkdir(URI uri) throws IOException { LOGGER.info("mkdir {}", uri); try { Preconditions.checkNotNull(uri, "uri is null"); String path = normalizeToDirectoryPrefix(uri); if (path.equals(DELIMITER)) { return true; } PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(uri.getHost()).key(path).build(); PutObjectResponse putObjectResponse = _s3Client.putObject(putObjectRequest, RequestBody.fromBytes(new byte[0])); return putObjectResponse.sdkHttpResponse().isSuccessful(); } catch (Throwable t) { throw new IOException(t); } }
S3PinotFS extends PinotFS { @Override public boolean mkdir(URI uri) throws IOException { LOGGER.info("mkdir {}", uri); try { Preconditions.checkNotNull(uri, "uri is null"); String path = normalizeToDirectoryPrefix(uri); if (path.equals(DELIMITER)) { return true; } PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(uri.getHost()).key(path).build(); PutObjectResponse putObjectResponse = _s3Client.putObject(putObjectRequest, RequestBody.fromBytes(new byte[0])); return putObjectResponse.sdkHttpResponse().isSuccessful(); } catch (Throwable t) { throw new IOException(t); } } }
S3PinotFS extends PinotFS { @Override public boolean mkdir(URI uri) throws IOException { LOGGER.info("mkdir {}", uri); try { Preconditions.checkNotNull(uri, "uri is null"); String path = normalizeToDirectoryPrefix(uri); if (path.equals(DELIMITER)) { return true; } PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(uri.getHost()).key(path).build(); PutObjectResponse putObjectResponse = _s3Client.putObject(putObjectRequest, RequestBody.fromBytes(new byte[0])); return putObjectResponse.sdkHttpResponse().isSuccessful(); } catch (Throwable t) { throw new IOException(t); } }  }
S3PinotFS extends PinotFS { @Override public boolean mkdir(URI uri) throws IOException { LOGGER.info("mkdir {}", uri); try { Preconditions.checkNotNull(uri, "uri is null"); String path = normalizeToDirectoryPrefix(uri); if (path.equals(DELIMITER)) { return true; } PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(uri.getHost()).key(path).build(); PutObjectResponse putObjectResponse = _s3Client.putObject(putObjectRequest, RequestBody.fromBytes(new byte[0])); return putObjectResponse.sdkHttpResponse().isSuccessful(); } catch (Throwable t) { throw new IOException(t); } }  @Override void init(PinotConfiguration config); void init(S3Client s3Client); @Override boolean mkdir(URI uri); @Override boolean delete(URI segmentUri, boolean forceDelete); @Override boolean doMove(URI srcUri, URI dstUri); @Override boolean copy(URI srcUri, URI dstUri); @Override boolean exists(URI fileUri); @Override long length(URI fileUri); @Override String[] listFiles(URI fileUri, boolean recursive); @Override void copyToLocalFile(URI srcUri, File dstFile); @Override void copyFromLocalFile(File srcFile, URI dstUri); @Override boolean isDirectory(URI uri); @Override long lastModified(URI uri); @Override boolean touch(URI uri); @Override InputStream open(URI uri); @Override void close(); }
S3PinotFS extends PinotFS { @Override public boolean mkdir(URI uri) throws IOException { LOGGER.info("mkdir {}", uri); try { Preconditions.checkNotNull(uri, "uri is null"); String path = normalizeToDirectoryPrefix(uri); if (path.equals(DELIMITER)) { return true; } PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(uri.getHost()).key(path).build(); PutObjectResponse putObjectResponse = _s3Client.putObject(putObjectRequest, RequestBody.fromBytes(new byte[0])); return putObjectResponse.sdkHttpResponse().isSuccessful(); } catch (Throwable t) { throw new IOException(t); } }  @Override void init(PinotConfiguration config); void init(S3Client s3Client); @Override boolean mkdir(URI uri); @Override boolean delete(URI segmentUri, boolean forceDelete); @Override boolean doMove(URI srcUri, URI dstUri); @Override boolean copy(URI srcUri, URI dstUri); @Override boolean exists(URI fileUri); @Override long length(URI fileUri); @Override String[] listFiles(URI fileUri, boolean recursive); @Override void copyToLocalFile(URI srcUri, File dstFile); @Override void copyFromLocalFile(File srcFile, URI dstUri); @Override boolean isDirectory(URI uri); @Override long lastModified(URI uri); @Override boolean touch(URI uri); @Override InputStream open(URI uri); @Override void close(); static final String ACCESS_KEY; static final String SECRET_KEY; static final String REGION; static final String ENDPOINT; static final String S3_SCHEME; }