Ingestion queue enabled
This commit is contained in:
@@ -9,7 +9,7 @@ ARG JAR_FILE=target/apollo-0.0.1-SNAPSHOT.jar
|
|||||||
# Add the application's jar to the container
|
# Add the application's jar to the container
|
||||||
ADD ${JAR_FILE} /apollo.jar
|
ADD ${JAR_FILE} /apollo.jar
|
||||||
|
|
||||||
ENV JAVA_OPTS="-Xms4096m -Xmx6g -Xss2048m"
|
ENV JAVA_OPTS="-Xms4096m -Xmx6g -Xss512m"
|
||||||
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /apollo.jar"]
|
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /apollo.jar"]
|
||||||
|
|
||||||
#ENTRYPOINT ["java","-jar","/apollo.jar"]
|
#ENTRYPOINT ["java","-jar","/apollo.jar"]
|
||||||
@@ -98,6 +98,8 @@ public class KSIngestor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public IngestionOutput ingestDocumentByIdAsync(String id) {
|
public IngestionOutput ingestDocumentByIdAsync(String id) {
|
||||||
IngestionOutput ingestionOutput= new IngestionOutput();
|
IngestionOutput ingestionOutput= new IngestionOutput();
|
||||||
Optional<KSDocument> optionalDocument = ksDocumentRepository.findById(id);
|
Optional<KSDocument> optionalDocument = ksDocumentRepository.findById(id);
|
||||||
@@ -117,6 +119,28 @@ public class KSIngestor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IngestionOutput setDocumentInQueueIngestion(String id) {
|
||||||
|
IngestionOutput ingestionOutput= new IngestionOutput();
|
||||||
|
Optional<KSDocument> optionalDocument = ksDocumentRepository.findById(id);
|
||||||
|
if (optionalDocument.isPresent()) {
|
||||||
|
KSDocument ksDocument = optionalDocument.get();
|
||||||
|
if ("LOADED".equals(ksDocument.getIngestionStatus()) || "ERROR".equals(ksDocument.getIngestionStatus())) {
|
||||||
|
ksDocument.setIngestionStatus("INGESTION_QUEUE");
|
||||||
|
ksDocumentRepository.save(ksDocument);
|
||||||
|
ingestionOutput.setMessage("Document added to ingestion queue...");
|
||||||
|
ingestionOutput.setStatus("INGESTION_QUEUE");
|
||||||
|
return ingestionOutput;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ingestionOutput.setMessage("OOPS: Document is already Injected");
|
||||||
|
return ingestionOutput;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ingestionOutput.setMessage("OOPS: Document Not found");
|
||||||
|
return ingestionOutput;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Async
|
@Async
|
||||||
private CompletableFuture<Void> ingestDocumentAsync(KSDocument ksDocument) {
|
private CompletableFuture<Void> ingestDocumentAsync(KSDocument ksDocument) {
|
||||||
ingestDocument(ksDocument);
|
ingestDocument(ksDocument);
|
||||||
|
|||||||
Reference in New Issue
Block a user