@Override public Map<String, SystemStreamMetadata> apply() { throw new SamzaException("Failed to get system stream metadata"); } };
@Override public String toString() { return "SystemStreamPartition [" + system + ", " + stream + ", " + partition.getPartitionId() + "]"; }
public Partition(SystemStreamPartition systemStreamPartition) { this(systemStreamPartition.getSystem(), systemStreamPartition.getStream(), systemStreamPartition.getPartition().getPartitionId()); }
/** * @return The bootstrapped configuration that's been read after bootstrap has * been invoked. */ public Config getConfig() { if (isBootstrapped) { return new MapConfig(configMap); } else { throw new SamzaException("Must call bootstrap before retrieving config."); } }
@Override public Map<SystemStreamPartition, List<IncomingMessageEnvelope>> poll( Set<SystemStreamPartition> ssps, long timeout) throws InterruptedException { if (callbackException != null) { throw new SamzaException(callbackException); } return super.poll(ssps, timeout); }
public static SingleFileHdfsReader getHdfsReader(ReaderType readerType, SystemStreamPartition systemStreamPartition) { switch (readerType) { case AVRO: return new AvroFileHdfsReader(systemStreamPartition); default: throw new SamzaException("Unsupported reader type: " + readerType); } }
private void checkValidKey(String key, String fieldUsed) { if (key == null || key.matches(REGEX_INVALID_KEY)) { throw new AzureException(String.format("Cannot insert to Azure Checkpoint Manager; %s %s contains invalid characters [*, /, \\\\, ?]", fieldUsed, key)); } }
public byte[] toBytes(T obj) { throw new SamzaException("NoOpSerde toBytes should not be invoked by the framework."); } }
@Override public String toString() { return "SystemStreamPartition [" + system + ", " + stream + ", " + partition.getPartitionId() + "]"; }
@Override public Map<String, SystemStreamMetadata> apply() { throw new SamzaException("Failed to get system stream metadata"); } };
@Override public Map<String, SystemStreamMetadata> apply() { throw new SamzaException("Failed to get system stream metadata"); } };
public byte[] toBytes(T obj) { throw new SamzaException("NoOpSerde toBytes should not be invoked by the framework."); } }
public T fromBytes(byte[] bytes) { throw new SamzaException("NoOpSerde fromBytes should not be invoked by the framework."); }
public T fromBytes(byte[] bytes) { throw new SamzaException("NoOpSerde fromBytes should not be invoked by the framework."); }
protected static String getStreamName(String jobName, String jobId) { if (jobName == null) { throw new SamzaException("job name is null. Please specify job.name"); } if (jobId == null) { jobId = "1"; } String streamName = "__samza_" + jobName + "_" + jobId + "_logs"; return streamName.replace("-", "_"); }
private String validateRequiredConfig(String value, String fieldName, String systemName, String streamName) { if (value == null) { throw new SamzaException(String.format("Missing %s configuration for system: %s, stream: %s", fieldName, systemName, streamName)); } return value; }
public ProcessorData(String data) { String[] splt = data.split(" "); if (splt.length != 2) { throw new SamzaException("incorrect processor data format = " + data); } locationId = splt[0]; processorId = splt[1]; }
public SystemAdmin getSystemAdmin(String systemName) { if (!systemAdminMap.containsKey(systemName)) { throw new SamzaException("Cannot get systemAdmin for system " + systemName); } return systemAdminMap.get(systemName); }
@Override public ReadWriteTable getTable() { throw new SamzaException("Not implemented"); }