Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SP-5820] : Backport of BACKLOG-34864 #2155

Open
wants to merge 1 commit into
base: 9.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public class HadoopClusterManager implements RuntimeTestProgressCallback {
private static final String CONFIG_PROPERTIES = "config.properties";
private static final String KEYTAB_AUTH_FILE = "keytabAuthFile";
private static final String KEYTAB_IMPL_FILE = "keytabImpFile";
public static final String MAPR_SHIM = "Map-R";
public static final String MAPRFS_SCHEME = "maprfs";

private static final LogChannelInterface log =
KettleLogStore.getLogChannelInterfaceFactory().create( "HadoopClusterManager" );
Expand Down Expand Up @@ -212,6 +214,9 @@ public JSONObject importNamedCluster( ThinNameClusterModel model,
nc.setName( model.getName() );
nc.setHdfsUsername( model.getHdfsUsername() );
nc.setHdfsPassword( nc.encodePassword( model.getHdfsPassword() ) );
if (MAPR_SHIM.equals(model.getShimVendor())) {
nc.setStorageScheme(MAPRFS_SCHEME);
}
if ( variableSpace != null ) {
nc.shareVariablesWith( variableSpace );
} else {
Expand Down Expand Up @@ -260,6 +265,9 @@ private NamedCluster convertToNamedCluster( ThinNameClusterModel model ) {
nc.setOozieUrl( model.getOozieUrl() );
nc.setKafkaBootstrapServers( model.getKafkaBootstrapServers() );
resolveShimIdentifier( nc, model.getShimVendor(), model.getShimVersion() );
if (MAPR_SHIM.equals(model.getShimVendor())) {
nc.setStorageScheme(MAPRFS_SCHEME);
}
setupKnoxSecurity( nc, model );
if ( variableSpace != null ) {
nc.shareVariablesWith( variableSpace );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public class HadoopClusterManagerTest {
private static final String HIVE_SITE = "hive-site.xml";
private static final String OOZIE_SITE = "oozie-site.xml";
private static final String YARN_SITE = "yarn-site.xml";
public static final String MAPR_SHIM_VENDOR = "Map-R";
public static final String MAPRFS_SCHEME = "maprfs";

@Mock private Spoon spoon;
@Mock private LogChannelInterfaceFactory logChannelFactory;
Expand Down Expand Up @@ -224,6 +226,14 @@ public class HadoopClusterManagerTest {
model.setName( ncTestName );
JSONObject result = hadoopClusterManager.createNamedCluster( model, getFiles( "/" ) );
assertEquals( ncTestName, result.get( "namedCluster" ) );
verify( namedCluster, never() ).setStorageScheme( any( String.class ) );
}

@Test public void testMaprCreateNamedCluster() {
ThinNameClusterModel model = new ThinNameClusterModel();
model.setShimVendor(MAPR_SHIM_VENDOR);
JSONObject result = hadoopClusterManager.createNamedCluster( model, getFiles( "/" ) );
verify( namedCluster ).setStorageScheme( eq( MAPRFS_SCHEME ));
}

@Test public void testOverwriteNamedClusterCaseInsensitive() {
Expand Down