Skip to content

Commit

Permalink
some of APs feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kwatters committed Jul 27, 2023
1 parent b784c4a commit f92549a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.StaxDriver;

public class Configuration implements Serializable {
public abstract class Configuration implements Serializable {

// TODO: add a map type.
// TODO: push the name/class onto this ?
Expand All @@ -22,14 +22,9 @@ public class Configuration implements Serializable {
*
*/
private static final long serialVersionUID = 1L;
public HashMap<String, Object> config = null;
// private XStream xstream = null;
public HashMap<String, Object> config = new HashMap<String, Object>();

public Configuration() {
config = new HashMap<String, Object>();
// figure that we need to be able to serialize / deserialize
// TODO: consider a faster driver / serializer
// xstream = new XStream(new StaxDriver());
}

public void setStringParam(String name, String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@

public class StageConfiguration extends Configuration {

// private HashMap<String, Object> config = null;

private String stageName = "defaultStage";
private String stageClass = "org.myrobotlab.document.transformer.AbstractStage";

public StageConfiguration(String stageName, String stageClass) {
config = new HashMap<String, Object>();
this.stageName = stageName;
this.stageClass = stageClass;
}

public StageConfiguration() {
// depricate this constructor?
config = new HashMap<String, Object>();
}

@Override
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/myrobotlab/service/Solr.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ public synchronized void startEmbedded(String path) throws SolrServerException,
*/
public void addDocument(SolrInputDocument doc) {
// Always batch!
ArrayList<SolrInputDocument> docs = new ArrayList<SolrInputDocument>();
docs.add(doc);
addDocuments(docs);
addDocuments(List.of(doc));
}

/**
Expand Down Expand Up @@ -670,11 +668,9 @@ private SolrInputDocument convertDocument(Document doc) {
@Override
public ProcessingStatus onDocument(Document doc) {
// always be batching when sending docs.
ArrayList<Document> docs = new ArrayList<Document>();
docs.add(doc);
// TODO: we want to add to the current batch to send..
// and make sure we have a thread flushing the batch if it gets too old.
return onDocuments(docs);
return onDocuments(List.of(doc));
}

@Override
Expand Down
11 changes: 0 additions & 11 deletions src/main/resources/resource/config/mediasearch/python.yml

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/resource/config/mediasearch/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ peers: null
registry:
- runtime
- security
- python
- webgui
- solr
- audiofile
Expand Down

0 comments on commit f92549a

Please sign in to comment.