This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pattern p = Pattern.compile("[a-z0–9._-]+"); | |
if (!p.matcher(bucket).matches()) { | |
collector.addFailure("Allowed characters are lowercase characters, numbers,'.', '_', and '-'", "Bucket name should only contain allowed characters.'").withConfigProperty("bucket"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void configurePipeline(PipelineConfigurer configurer) { | |
StageConfigurer stageConfigurer = configurer.getStageConfigurer(); | |
// get failure collector from stage configurer | |
FailureCollector collector = stageConfigurer.getFailureCollector(); | |
// use failure collector to collect multiple validation failures | |
config.validate(collector); | |
validatePartitionProperties(collector); | |
validateConfiguredSchema(configuredSchema, collector); | |
stageConfigurer.setOutputSchema(configuredSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface FailureCollector { | |
/** | |
* Add a validation failure to this failure collector. The method returns the validation failure that was added to | |
* the failure collector. This failure can be used to add additional {@link ValidationFailure.Cause}s. | |
* For example, | |
* <code>failureCollector.addFailure("message", "action").withConfigProperty("configProperty");</code> | |
* | |
* @param message failure message | |
* @param correctiveAction corrective action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IncrementTest extends LongRunningTestBase<IncrementTestState> { | |
private static final int BATCH_SIZE = 100; | |
public static final int SUM_BATCH = (BATCH_SIZE * (BATCH_SIZE - 1)) / 2; | |
@Override | |
public void deploy() throws Exception { | |
deployApplication(getLongRunningNamespace(), IncrementApp.class); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IncrementTest extends LongRunningTestBase<IncrementTestState> { | |
private static final int BATCH_SIZE = 100; | |
public static final int SUM_BATCH = (BATCH_SIZE * (BATCH_SIZE - 1)) / 2; | |
@Override | |
public void deploy() throws Exception { | |
deployApplication(getLongRunningNamespace(), IncrementApp.class); | |
} | |
@Override |