Skip to content

Commit cab9333

Browse files
committed
* logdb downgrade for use previous grammar
* fixed to create logdb directory when start LogQueryServiceImpl * added LogRestoreService for delete the file Less than 40byte
1 parent aaa276e commit cab9333

File tree

212 files changed

+12303
-7792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+12303
-7792
lines changed

pom.xml

+686-686
Large diffs are not rendered by default.

siem/kraken-logdb/pom.xml

+6-19
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<version>1.0.0</version>
1010
</parent>
1111
<artifactId>kraken-logdb</artifactId>
12-
<version>0.10.0</version>
12+
<version>0.9.1</version>
1313
<packaging>bundle</packaging>
1414
<name>Kraken Log DB</name>
1515
<build>
@@ -25,9 +25,8 @@
2525
<Private-Package>
2626
org.krakenapps.logdb.impl,
2727
org.krakenapps.logdb.query,
28+
org.krakenapps.logdb.mapreduce,
2829
org.krakenapps.logdb.query.command,
29-
org.krakenapps.logdb.query.aggregator,
30-
org.krakenapps.logdb.query.expr,
3130
org.krakenapps.logdb.query.parser,
3231
org.krakenapps.logdb.sort,
3332
org.krakenapps.logdb.msgbus
@@ -38,7 +37,7 @@
3837
org.krakenapps.logstorage;version="1.12.0",
3938
org.krakenapps.logstorage.file;version="1.12.0",
4039
*
41-
</Import-Package>
40+
</Import-Package>
4241
</instructions>
4342
</configuration>
4443
</plugin>
@@ -60,16 +59,6 @@
6059
<groupId>org.krakenapps</groupId>
6160
<artifactId>kraken-api</artifactId>
6261
</dependency>
63-
<dependency>
64-
<groupId>org.slf4j</groupId>
65-
<artifactId>slf4j-api</artifactId>
66-
</dependency>
67-
<dependency>
68-
<groupId>org.slf4j</groupId>
69-
<artifactId>slf4j-simple</artifactId>
70-
<version>1.5.6</version>
71-
<scope>test</scope>
72-
</dependency>
7362
<dependency>
7463
<groupId>org.apache.felix</groupId>
7564
<artifactId>org.apache.felix.ipojo</artifactId>
@@ -80,7 +69,7 @@
8069
</dependency>
8170
<dependency>
8271
<groupId>org.krakenapps</groupId>
83-
<artifactId>kraken-confdb</artifactId>
72+
<artifactId>kraken-rpc</artifactId>
8473
</dependency>
8574
<dependency>
8675
<groupId>org.krakenapps</groupId>
@@ -103,10 +92,8 @@
10392
<artifactId>kraken-opencsv</artifactId>
10493
</dependency>
10594
<dependency>
106-
<groupId>org.mockito</groupId>
107-
<artifactId>mockito-all</artifactId>
108-
<version>1.9.5</version>
109-
<scope>test</scope>
95+
<groupId>org.krakenapps</groupId>
96+
<artifactId>kraken-bnf</artifactId>
11097
</dependency>
11198
</dependencies>
11299
</project>
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
1-
/*
2-
* Copyright 2012 Future Systems
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
161
package org.krakenapps.logdb;
172

183
import java.util.Map;
194

20-
public class BaseLogScript implements LogQueryScript {
5+
public class BaseLogScript implements LogScript {
216

227
@Override
238
public void init(Map<String, Object> params) {
249
}
2510

2611
@Override
27-
public void handle(LogQueryScriptInput input, LogQueryScriptOutput output) {
12+
public void handle(LogScriptInput input, LogScriptOutput output) {
2813
}
2914

3015
@Override
31-
public void eof(LogQueryScriptOutput output) {
16+
public void eof(LogScriptOutput output) {
3217
}
3318

3419
}

siem/kraken-logdb/src/main/java/org/krakenapps/logdb/CsvLookupRegistry.java

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
* Copyright 2012 Future Systems
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
161
package org.krakenapps.logdb;
172

183
import java.io.File;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.krakenapps.logdb;
2+
3+
import java.util.Map;
4+
5+
public interface DataSource {
6+
/**
7+
* @return "local" for local node, guid for remote node
8+
*/
9+
String getNodeGuid();
10+
11+
/**
12+
* @return "table" or "rpc"
13+
*/
14+
String getType();
15+
16+
/**
17+
* @return the data source name
18+
*/
19+
String getName();
20+
21+
/**
22+
* @return the data source metadata
23+
*/
24+
Map<String, Object> getMetadata();
25+
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.krakenapps.logdb;
2+
3+
public interface DataSourceEventListener {
4+
void onUpdate(DataSource ds);
5+
6+
void onRemove(DataSource ds);
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.krakenapps.logdb;
2+
3+
import java.util.Collection;
4+
5+
public interface DataSourceRegistry {
6+
Collection<DataSource> getAll();
7+
8+
DataSource get(String nodeGuid, String name);
9+
10+
void update(DataSource ds);
11+
12+
void remove(DataSource ds);
13+
14+
void addListener(DataSourceEventListener listener);
15+
16+
void removeListener(DataSourceEventListener listener);
17+
}

siem/kraken-logdb/src/main/java/org/krakenapps/logdb/EmptyLogQueryCallback.java

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
* Copyright 2012 Future Systems
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
161
package org.krakenapps.logdb;
172

183
public abstract class EmptyLogQueryCallback implements LogQueryCallback {

siem/kraken-logdb/src/main/java/org/krakenapps/logdb/LogQueryCommand.java

+22-8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.util.HashMap;
2020
import java.util.Map;
2121

22+
import org.krakenapps.logdb.query.FileBufferList;
23+
2224
public abstract class LogQueryCommand {
2325
public static enum Status {
2426
Waiting, Running, End, Finalizing
@@ -91,6 +93,26 @@ protected final void write(LogMap m) {
9193
}
9294
}
9395

96+
@Deprecated
97+
public void push(FileBufferList<Map<String, Object>> buf) {
98+
if (buf != null) {
99+
for (Map<String, Object> m : buf)
100+
push(new LogMap(m));
101+
buf.close();
102+
}
103+
}
104+
105+
@Deprecated
106+
protected final void write(FileBufferList<Map<String, Object>> buf) {
107+
pushCount += buf.size();
108+
if (next != null && next.status != Status.End) {
109+
next.status = Status.Running;
110+
next.push(buf);
111+
} else {
112+
buf.close();
113+
}
114+
}
115+
94116
public abstract boolean isReducer();
95117

96118
public boolean isCallbackTimeline() {
@@ -165,13 +187,5 @@ public boolean containsKey(String key) {
165187
public Map<String, Object> map() {
166188
return map;
167189
}
168-
169-
@Override
170-
public String toString() {
171-
if (map != null)
172-
return map.toString();
173-
return "null";
174-
}
175-
176190
}
177191
}

siem/kraken-logdb/src/main/java/org/krakenapps/logdb/LogQueryContext.java

-19
This file was deleted.

siem/kraken-logdb/src/main/java/org/krakenapps/logdb/LogQueryEventListener.java

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
* Copyright 2011 Future Systems
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
161
package org.krakenapps.logdb;
172

183
public interface LogQueryEventListener {

siem/kraken-logdb/src/main/java/org/krakenapps/logdb/LogQueryParseException.java

-48
This file was deleted.

siem/kraken-logdb/src/main/java/org/krakenapps/logdb/LogQueryCommandParser.java siem/kraken-logdb/src/main/java/org/krakenapps/logdb/LogQueryParser.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013 Future Systems
2+
* Copyright 2011 Future Systems
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,8 +15,9 @@
1515
*/
1616
package org.krakenapps.logdb;
1717

18-
public interface LogQueryCommandParser {
19-
String getCommandName();
18+
import org.krakenapps.bnf.Parser;
19+
import org.krakenapps.bnf.Syntax;
2020

21-
LogQueryCommand parse(LogQueryContext context, String commandString);
21+
public interface LogQueryParser extends Parser {
22+
void addSyntax(Syntax syntax);
2223
}

siem/kraken-logdb/src/main/java/org/krakenapps/logdb/LogQueryParserService.java

-24
This file was deleted.

0 commit comments

Comments
 (0)