Skip to content
This repository has been archived by the owner on Jun 2, 2019. It is now read-only.

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
dethi committed Dec 9, 2017
1 parent 7d90898 commit c4b5cc6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion domain/src/main/java/com/epita/domain/Indexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface Indexer {
* @param url The url to index
* @return The result document
*/
Document index(final String text, final String url);
Document index(final String text, final String url);

/**
* Search a query in a list of document
Expand Down
2 changes: 0 additions & 2 deletions eventbus/src/main/java/com/epita/eventbus/EventBusClient.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.epita.eventbus;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import java.time.LocalDateTime;
import java.util.function.Consumer;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/epita/guereza/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected App(final EventBusClient eventBus) {
* Send an object through the eventBus
*
* @param channel The channel to send message
* @param obj The object to send
* @param obj The object to send
*/
public void sendMessage(final String channel, final Object obj) {
try {
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/com/epita/guereza/EventStoreApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.epita.domain.Document;
import com.epita.eventbus.EventBusClient;
import com.epita.eventbus.EventMessage;
import com.epita.guereza.eventsourcing.Event;
import com.epita.guereza.eventsourcing.EventStore;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -37,25 +36,25 @@ private void extractThen(final EventBusClient.Message msg, final Consumer<Object
public void run() {
eventBus.subscribe("/request/crawler/url", msg -> {
extractThen(msg, o -> {
Event<String> ev = new Event<>("CRAWLER_REQUEST_URL", String.class, (String)o);
Event<String> ev = new Event<>("CRAWLER_REQUEST_URL", String.class, (String) o);
eventStore.dispatch(ev);
});
});
eventBus.subscribe("/request/indexer/url", msg -> {
extractThen(msg, o -> {
Event<String> ev = new Event<>("INDEXER_REQUEST_URL", String.class, (String)o);
Event<String> ev = new Event<>("INDEXER_REQUEST_URL", String.class, (String) o);
eventStore.dispatch(ev);
});
});
eventBus.subscribe("/store/crawler", msg -> {
extractThen(msg, o -> {
Event<String[]> ev = new Event<>("ADD_URLS", String[].class, (String[])o);
Event<String[]> ev = new Event<>("ADD_URLS", String[].class, (String[]) o);
eventStore.dispatch(ev);
});
});
eventBus.subscribe("/store/indexer", msg -> {
extractThen(msg, o -> {
Event<Document> ev = new Event<>("ADD_DOCUMENT", Document.class, (Document)o);
Event<Document> ev = new Event<>("ADD_DOCUMENT", Document.class, (Document) o);
eventStore.dispatch(ev);
});
});
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/epita/guereza/IndexerApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.Duration;
import java.util.concurrent.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class IndexerApp extends App {
private static final Logger LOGGER = LoggerFactory.getLogger(IndexerApp.class);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/epita/guereza/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import com.epita.winter.provider.LazySingleton;
import com.epita.winter.provider.Prototype;
import com.epita.winter.provider.Singleton;
import com.sun.security.ntlm.Server;

import java.util.Map;
import java.util.function.Function;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/epita/guereza/UrlStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;

public class UrlStore implements Reducer {
private static final Logger LOGGER = LoggerFactory.getLogger(CrawlerService.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.epita.guereza.service.indexer;

import com.epita.domain.*;
import com.epita.domain.Document;
import com.epita.domain.Indexer;
import com.epita.domain.Term;
import com.epita.guereza.service.CrawlerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down

0 comments on commit c4b5cc6

Please sign in to comment.