use of org.talend.components.simplefileio.SimpleFileIODatastoreProperties in project components by Talend.
the class SimpleFileIODatasetRuntime method getReadWriteUgiDoAs.
/**
* Helper method for any runtime to get the appropriate {@link UgiDoAs} for executing.
*
* @param datasetProperties dataset properties, containing credentials for the cluster.
* @param accessType the type of access to the dataset that the user will be performing.
* @return An object that can be used to execute actions with the correct credentials.
*/
public static UgiDoAs getReadWriteUgiDoAs(SimpleFileIODatasetProperties datasetProperties, UgiExceptionHandler.AccessType accessType) {
String path = datasetProperties.path.getValue();
SimpleFileIODatastoreProperties datastoreProperties = datasetProperties.getDatastoreProperties();
if (datastoreProperties.useKerberos.getValue()) {
UgiDoAs doAs = UgiDoAs.ofKerberos(datastoreProperties.kerberosPrincipal.getValue(), datastoreProperties.kerberosKeytab.getValue());
return new UgiExceptionHandler(doAs, accessType, datastoreProperties.kerberosPrincipal.getValue(), path);
} else if (datastoreProperties.userName.getValue() != null && !datastoreProperties.userName.getValue().isEmpty()) {
UgiDoAs doAs = UgiDoAs.ofSimple(datastoreProperties.userName.getValue());
return new UgiExceptionHandler(doAs, accessType, datastoreProperties.userName.getValue(), path);
} else {
return new UgiExceptionHandler(UgiDoAs.ofNone(), accessType, null, path);
}
}
use of org.talend.components.simplefileio.SimpleFileIODatastoreProperties in project components by Talend.
the class SandboxedSimpleFileIODatasetRuntimeTest method createDatasetProperties.
/**
* @return the properties for this dataset, fully initialized with the default values.
*/
public static SimpleFileIODatasetProperties createDatasetProperties() {
// Configure the dataset.
SimpleFileIODatastoreProperties datastoreProps = new SimpleFileIODatastoreProperties(null);
datastoreProps.init();
SimpleFileIODatasetProperties datasetProps = new SimpleFileIODatasetProperties(null);
datasetProps.init();
datasetProps.setDatastoreProperties(datastoreProps);
return datasetProps;
}
use of org.talend.components.simplefileio.SimpleFileIODatastoreProperties in project components by Talend.
the class SimpleFileIODatasetRuntimeTest method createDatasetProperties.
/**
* @return the properties for this dataset, fully initialized with the default values.
*/
public static SimpleFileIODatasetProperties createDatasetProperties() {
// Configure the dataset.
SimpleFileIODatastoreProperties datastoreProps = new SimpleFileIODatastoreProperties(null);
datastoreProps.init();
SimpleFileIODatasetProperties datasetProps = new SimpleFileIODatasetProperties(null);
datasetProps.init();
datasetProps.setDatastoreProperties(datastoreProps);
return datasetProps;
}
use of org.talend.components.simplefileio.SimpleFileIODatastoreProperties in project components by Talend.
the class SimpleFileIOOutputPropertiesTest method setup.
@Before
public void setup() {
properties = new SimpleFileIOOutputProperties("test");
SimpleFileIODatastoreProperties datastoreProperties = new SimpleFileIODatastoreProperties("test");
datastoreProperties.init();
SimpleFileIODatasetProperties datasetProperties = new SimpleFileIODatasetProperties("test");
datasetProperties.init();
datasetProperties.setDatastoreProperties(datastoreProperties);
properties.setDatasetProperties(datasetProperties);
properties.init();
}
use of org.talend.components.simplefileio.SimpleFileIODatastoreProperties in project components by Talend.
the class SimpleFileIODatastoreRuntimeTest method createDatastoreProperties.
/**
* @return the properties for this datastore, fully initialized with the default values.
*/
public static SimpleFileIODatastoreProperties createDatastoreProperties() {
// Configure the datastore.
SimpleFileIODatastoreProperties datastoreProps = new SimpleFileIODatastoreProperties(null);
datastoreProps.init();
return datastoreProps;
}
Aggregations