public final class DirectIoTestHelper extends Object
Constructor and Description |
---|
DirectIoTestHelper(TestContext context,
String rootPath)
Creates a new instance.
|
DirectIoTestHelper(TestContext context,
String rootPath,
org.apache.hadoop.conf.Configuration configuration)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
<T> ModelInput<T> |
openInput(Class<T> dataType,
DirectFileOutputDescription description)
Opens input for the target output.
|
<T> ModelOutput<T> |
openOutput(Class<T> dataType,
DirectFileInputDescription description)
Opens output for the target input.
|
void |
truncate()
Truncates the current target (deletes all on base path).
|
void |
truncate(String resourcePattern)
Truncates the current target.
|
public DirectIoTestHelper(TestContext context, String rootPath) throws IOException
context
- current test contextrootPath
- the bare original base pathIOException
- if failed to create a new instanceIllegalArgumentException
- if some parameters were null
public DirectIoTestHelper(TestContext context, String rootPath, org.apache.hadoop.conf.Configuration configuration) throws IOException
context
- current test contextrootPath
- the bare original base pathconfiguration
- the testing configurationIOException
- if failed to create a new instanceIllegalArgumentException
- if some parameters were null
public void truncate() throws IOException
IOException
- if failed to perform by I/O errorpublic void truncate(String resourcePattern) throws IOException
resourcePattern
- the target resource patternIOException
- if failed to perform by I/O errorpublic <T> ModelOutput<T> openOutput(Class<T> dataType, DirectFileInputDescription description) throws IOException
T
- data typedataType
- data typedescription
- target descriptionIOException
- if failed to perform by I/O errorIllegalArgumentException
- if some parameters were null
public <T> ModelInput<T> openInput(Class<T> dataType, DirectFileOutputDescription description) throws IOException
T
- data typedataType
- data typedescription
- target descriptionIOException
- if failed to perform by I/O errorIllegalArgumentException
- if some parameters were null
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.