Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
1907f640
Commit
1907f640
authored
4 years ago
by
Andras Katona
Committed by
nixonrodrigues
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-4063: EmbeddedKafkaServer simplification
Signed-off-by:
nixonrodrigues
<
nixon@apache.org
>
parent
321c6b83
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
35 deletions
+2
-35
EmbeddedKafkaServer.java
...main/java/org/apache/atlas/kafka/EmbeddedKafkaServer.java
+2
-35
No files found.
notification/src/main/java/org/apache/atlas/kafka/EmbeddedKafkaServer.java
View file @
1907f640
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
*/
*/
package
org
.
apache
.
atlas
.
kafka
;
package
org
.
apache
.
atlas
.
kafka
;
import
kafka.metrics.KafkaMetricsReporter
;
import
kafka.server.KafkaConfig
;
import
kafka.server.KafkaConfig
;
import
kafka.server.KafkaServer
;
import
kafka.server.KafkaServer
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.ApplicationProperties
;
...
@@ -35,7 +34,7 @@ import org.slf4j.LoggerFactory;
...
@@ -35,7 +34,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
scala.Option
;
import
scala.Option
;
import
scala.collection.mutable.Buffer
;
import
scala.collection.mutable.
Array
Buffer
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
java.io.File
;
import
java.io.File
;
...
@@ -45,7 +44,6 @@ import java.net.MalformedURLException;
...
@@ -45,7 +44,6 @@ import java.net.MalformedURLException;
import
java.net.URISyntaxException
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
@Component
@Component
...
@@ -138,10 +136,7 @@ public class EmbeddedKafkaServer implements Service {
...
@@ -138,10 +136,7 @@ public class EmbeddedKafkaServer implements Service {
brokerConfig
.
setProperty
(
"log.dirs"
,
constructDir
(
"kafka"
).
getAbsolutePath
());
brokerConfig
.
setProperty
(
"log.dirs"
,
constructDir
(
"kafka"
).
getAbsolutePath
());
brokerConfig
.
setProperty
(
"log.flush.interval.messages"
,
String
.
valueOf
(
1
));
brokerConfig
.
setProperty
(
"log.flush.interval.messages"
,
String
.
valueOf
(
1
));
List
<
KafkaMetricsReporter
>
metrics
=
new
ArrayList
<>();
kafkaServer
=
new
KafkaServer
(
KafkaConfig
.
fromProps
(
brokerConfig
),
Time
.
SYSTEM
,
Option
.
apply
(
this
.
getClass
().
getName
()),
new
ArrayBuffer
<>());
Buffer
<
KafkaMetricsReporter
>
metricsReporters
=
scala
.
collection
.
JavaConversions
.
asScalaBuffer
(
metrics
);
kafkaServer
=
new
KafkaServer
(
KafkaConfig
.
fromProps
(
brokerConfig
),
new
SystemTime
(),
Option
.
apply
(
this
.
getClass
().
getName
()),
metricsReporters
);
kafkaServer
.
startup
();
kafkaServer
.
startup
();
...
@@ -165,32 +160,4 @@ public class EmbeddedKafkaServer implements Service {
...
@@ -165,32 +160,4 @@ public class EmbeddedKafkaServer implements Service {
return
new
URL
(
"http://"
+
url
);
return
new
URL
(
"http://"
+
url
);
}
}
}
}
// ----- inner class : SystemTime ----------------------------------------
private
static
class
SystemTime
implements
Time
{
@Override
public
long
milliseconds
()
{
return
System
.
currentTimeMillis
();
}
@Override
public
long
nanoseconds
()
{
return
System
.
nanoTime
();
}
@Override
public
long
hiResClockMs
()
{
return
TimeUnit
.
NANOSECONDS
.
toMillis
(
nanoseconds
());
}
@Override
public
void
sleep
(
long
arg0
)
{
try
{
Thread
.
sleep
(
arg0
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment