Search in sources :

Example 1 with NeptuneExportLambda

use of com.amazonaws.services.neptune.export.NeptuneExportLambda in project amazon-neptune-tools by awslabs.

the class RunNeptuneExportSvc method run.

@Override
public void run() {
    InputStream input = new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8));
    try {
        new NeptuneExportLambda(rootPath, cleanRootPath, maxFileDescriptorCount).handleRequest(input, System.out, new Context() {

            @Override
            public String getAwsRequestId() {
                throw new NotImplementedException();
            }

            @Override
            public String getLogGroupName() {
                throw new NotImplementedException();
            }

            @Override
            public String getLogStreamName() {
                throw new NotImplementedException();
            }

            @Override
            public String getFunctionName() {
                throw new NotImplementedException();
            }

            @Override
            public String getFunctionVersion() {
                throw new NotImplementedException();
            }

            @Override
            public String getInvokedFunctionArn() {
                throw new NotImplementedException();
            }

            @Override
            public CognitoIdentity getIdentity() {
                throw new NotImplementedException();
            }

            @Override
            public ClientContext getClientContext() {
                throw new NotImplementedException();
            }

            @Override
            public int getRemainingTimeInMillis() {
                throw new NotImplementedException();
            }

            @Override
            public int getMemoryLimitInMB() {
                throw new NotImplementedException();
            }

            @Override
            public LambdaLogger getLogger() {
                return new LambdaLogger() {

                    @Override
                    public void log(String s) {
                        System.out.println(s);
                    }

                    @Override
                    public void log(byte[] bytes) {
                        throw new NotImplementedException();
                    }
                };
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
        System.err.println("An error occurred while exporting from Neptune: " + e.getMessage());
        System.exit(-1);
    }
    System.exit(0);
}
Also used : Context(com.amazonaws.services.lambda.runtime.Context) ClientContext(com.amazonaws.services.lambda.runtime.ClientContext) NeptuneExportLambda(com.amazonaws.services.neptune.export.NeptuneExportLambda) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) NotImplementedException(sun.reflect.generics.reflectiveObjects.NotImplementedException) ClientContext(com.amazonaws.services.lambda.runtime.ClientContext) CognitoIdentity(com.amazonaws.services.lambda.runtime.CognitoIdentity) LambdaLogger(com.amazonaws.services.lambda.runtime.LambdaLogger) NotImplementedException(sun.reflect.generics.reflectiveObjects.NotImplementedException)

Aggregations

ClientContext (com.amazonaws.services.lambda.runtime.ClientContext)1 CognitoIdentity (com.amazonaws.services.lambda.runtime.CognitoIdentity)1 Context (com.amazonaws.services.lambda.runtime.Context)1 LambdaLogger (com.amazonaws.services.lambda.runtime.LambdaLogger)1 NeptuneExportLambda (com.amazonaws.services.neptune.export.NeptuneExportLambda)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 NotImplementedException (sun.reflect.generics.reflectiveObjects.NotImplementedException)1