Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aomegax committed Aug 21, 2023
1 parent 10479af commit ea560bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.microsoft.azure.functions.annotation.Cardinality;
import com.microsoft.azure.functions.annotation.EventHubTrigger;
import com.microsoft.azure.functions.annotation.FunctionName;
import it.gov.pagopa.nodoretodatastore.util.ObjectMapperUtils;
import it.gov.pagopa.nodoretotablestorage.util.ObjectMapperUtils;

import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -71,7 +71,7 @@ private void addToBatch(Logger logger, Map<String,List<TableTransactionAction>>
}

private String replaceDashWithUppercase(String input) {
if(!input.contains("-")){
if(!input.contains("-")) {
return input;
}
Matcher matcher = replaceDashPattern.matcher(input);
Expand Down Expand Up @@ -121,8 +121,8 @@ public void processNodoReEvent (

TableClient tableClient = getTableServiceClient().getTableClient(tableName);

logger.info(String.format("Persisting %d events", reEvents.size()));
try {
try {
logger.info(String.format("Persisting %d events", reEvents.size()));
if (reEvents.size() == properties.length) {
Map<String,List<TableTransactionAction>> partitionEvents = new HashMap<>();

Expand All @@ -145,10 +145,10 @@ public void processNodoReEvent (
}

// save batch by partition keys
partitionEvents.forEach((pe, values)->{
partitionEvents.forEach((pe, values) -> {
try {
tableClient.submitTransaction(values);
} catch (Throwable t){
} catch (Throwable t) {
logger.severe("Could not save on tableStorage,partition "+pe+", "+values.size()+" rows,error:"+ t.toString());
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package it.gov.pagopa.nodoretodatastore.exception;
package it.gov.pagopa.nodoretotablestorage.exception;

public class AppException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package it.gov.pagopa.nodoretodatastore.util;
package it.gov.pagopa.nodoretotablestorage.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down

0 comments on commit ea560bc

Please sign in to comment.