Skip to content

Commit

Permalink
Fix Spellings and Code Cleanup (apache#3181)
Browse files Browse the repository at this point in the history
* Fix Spellings and Code Cleanup

* Fix Code comments

* Remove Tenant check

* Fix test cases
  • Loading branch information
aahmed-se authored and srkukarni committed Dec 13, 2018
1 parent e0792d6 commit 6df595a
Show file tree
Hide file tree
Showing 14 changed files with 246 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Collection<Metrics> getMBeans() throws Exception {

@GET
@Path("/destinations")
@ApiOperation(value = "Get all the topic stats by namesapce", response = OutputStream.class, responseContainer = "OutputStream") // https://github.com/swagger-api/swagger-ui/issues/558
@ApiOperation(value = "Get all the topic stats by namespace", response = OutputStream.class, responseContainer = "OutputStream") // https://github.com/swagger-api/swagger-ui/issues/558
// map
// support
// missing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Map<String, NamespaceOwnershipStatus> getOwnedNamespaes(@PathParam("clust
@ApiResponse(code = 403, message = "You don't have admin permission to update service-configuration"),
@ApiResponse(code = 404, message = "Configuration not found"),
@ApiResponse(code = 412, message = "Configuration can't be updated dynamically") })
public void updateDynamicConfiguration(@PathParam("configName") String configName, @PathParam("configValue") String configValue) throws Exception{
public void updateDynamicConfiguration(@PathParam("configName") String configName, @PathParam("configValue") String configValue) throws Exception {
validateSuperUserAccess();
updateDynamicConfigurationOnZk(configName, configValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public Map<String, NamespaceIsolationData> getNamespaceIsolationPolicies(@PathPa
.get(path("clusters", cluster, NAMESPACE_ISOLATION_POLICIES))
.orElseThrow(() -> new RestException(Status.NOT_FOUND,
"NamespaceIsolationPolicies for cluster " + cluster + " does not exist"));
// construct the response to NamespaceisolationData map
// construct the response to Namespace isolation data map
return nsIsolationPolicies.getPolicies();
} catch (Exception e) {
log.error("[{}] Failed to get clusters/{}/namespaceIsolationPolicies", clientAppId(), cluster, e);
Expand All @@ -368,7 +368,7 @@ public NamespaceIsolationData getNamespaceIsolationPolicy(@PathParam("cluster")
.get(path("clusters", cluster, NAMESPACE_ISOLATION_POLICIES))
.orElseThrow(() -> new RestException(Status.NOT_FOUND,
"NamespaceIsolationPolicies for cluster " + cluster + " does not exist"));
// construct the response to NamespaceisolationData map
// construct the response to Namespace isolation data map
if (!nsIsolationPolicies.getPolicies().containsKey(policyName)) {
log.info("[{}] Cannot find NamespaceIsolationPolicy {} for cluster {}", policyName, cluster);
throw new RestException(Status.NOT_FOUND,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected void internalSetNamespaceBundleResourceQuota(String bundleRange, Resou
} catch (KeeperException.NoNodeException e) {
log.warn("[{}] Failed to set resource quota for namespace bundle {}: concurrent modification",
clientAppId(), nsBundle.toString());
throw new RestException(Status.CONFLICT, "Cuncurrent modification on namespace bundle quota");
throw new RestException(Status.CONFLICT, "Concurrent modification on namespace bundle quota");
} catch (Exception e) {
log.error("[{}] Failed to set resource quota for namespace bundle {}", clientAppId(), nsBundle.toString());
throw new RestException(e);
Expand Down Expand Up @@ -123,7 +123,7 @@ protected void internalRemoveNamespaceBundleResourceQuota(String bundleRange) {
} catch (KeeperException.NoNodeException e) {
log.warn("[{}] Failed to unset resource quota for namespace bundle {}: concurrent modification",
clientAppId(), nsBundle.toString());
throw new RestException(Status.CONFLICT, "Cuncurrent modification on namespace bundle quota");
throw new RestException(Status.CONFLICT, "Concurrent modification on namespace bundle quota");
} catch (Exception e) {
log.error("[{}] Failed to unset resource quota for namespace bundle {}", clientAppId(),
nsBundle.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class BrokerStats extends BrokerStatsBase {
@GET
@Path("/topics")
@ApiOperation(
value = "Get all the topic stats by namesapce",
value = "Get all the topic stats by namespace",
response = OutputStream.class,
responseContainer = "OutputStream")
// https://github.com/swagger-api/swagger-ui/issues/558
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public CmdSinks(PulsarAdmin admin) {
jcommander.addCommand("delete", deleteSink);
jcommander.addCommand("list", listSinks);
jcommander.addCommand("get", getSink);
// TODO depecreate getstatus
// TODO deprecate getstatus
jcommander.addCommand("status", getSinkStatus, "getstatus");
jcommander.addCommand("stop", stopSink);
jcommander.addCommand("restart", restartSink);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ protected Map<String, Object> parseConfigs(String str) {

protected void validateSourceConfigs(SourceConfig sourceConfig) {
if (isBlank(sourceConfig.getArchive())) {
throw new ParameterException("Source archive not specfied");
throw new ParameterException("Source archive not specified");
}
org.apache.pulsar.common.functions.Utils.inferMissingArguments(sourceConfig);
if (!Utils.isFunctionPackageUrlSupported(sourceConfig.getArchive()) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void testMissingProcessingGuarantees() throws Exception {
);
}

@Test(expectedExceptions = ParameterException.class, expectedExceptionsMessageRegExp = "Source archive not specfied")
@Test(expectedExceptions = ParameterException.class, expectedExceptionsMessageRegExp = "Source archive not specified")
public void testMissingArchive() throws Exception {
SourceConfig sourceConfig = getSourceConfig();
sourceConfig.setArchive(null);
Expand Down Expand Up @@ -356,7 +356,7 @@ public void testCmdSourceConfigFileMissingResources() throws Exception {
testCmdSourceConfigFile(testSourceConfig, expectedSourceConfig);
}

@Test(expectedExceptions = ParameterException.class, expectedExceptionsMessageRegExp = "Source archive not specfied")
@Test(expectedExceptions = ParameterException.class, expectedExceptionsMessageRegExp = "Source archive not specified")
public void testCmdSourceConfigFileMissingJar() throws Exception {
SourceConfig testSourceConfig = getSourceConfig();
testSourceConfig.setArchive(null);
Expand Down
Loading

0 comments on commit 6df595a

Please sign in to comment.