Skip to content

Commit

Permalink
update gadtry to 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
harbby committed Aug 21, 2021
1 parent 03c602a commit 185c9ed
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ allprojects {
joda_time : '2.9.3',
slf4j : '1.7.25',
guice : '4.2.1',
gadtry : '1.9.2-SNAPSHOT',
gadtry : '1.9.2',
guava : '27.0-jre',
jackson : '2.9.8',
jersey : '2.28',
Expand Down
2 changes: 1 addition & 1 deletion sylph-main/src/main/java/ideal/sylph/main/SylphMaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static void main(String[] args)
binder.bind(ControllerApp.class).withSingle()
).aop(new AuthAspect()).initialize();
//----analysis
logger.info("Analyzed App dependencies {}", String.join("\n", app.analysis().printShow()));
logger.info("Analyzed App dependencies {}", String.join("\n", app.analyze().printShow()));

app.getInstance(JobEngineManager.class).loadRunners();
app.getInstance(OperatorManager.class).loadPlugins();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package ideal.sylph.main.server;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.harbby.gadtry.easyspi.Module;
import com.github.harbby.gadtry.spi.Module;
import ideal.sylph.etl.Plugin;
import ideal.sylph.main.service.JobEngineManager;
import ideal.sylph.main.service.JobManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import com.github.harbby.gadtry.base.Closeables;
import com.github.harbby.gadtry.base.Throwables;
import com.github.harbby.gadtry.easyspi.ModuleLoader;
import com.github.harbby.gadtry.spi.ModuleLoader;
import com.github.harbby.gadtry.ioc.Autowired;
import com.google.common.collect.ImmutableList;
import ideal.sylph.etl.Operator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

import com.github.harbby.gadtry.base.Try;
import com.github.harbby.gadtry.collection.ImmutableList;
import com.github.harbby.gadtry.easyspi.Module;
import com.github.harbby.gadtry.easyspi.ModuleLoader;
import com.github.harbby.gadtry.easyspi.SecurityClassLoader;
import com.github.harbby.gadtry.easyspi.VolatileClassLoader;
import com.github.harbby.gadtry.ioc.Autowired;
import com.github.harbby.gadtry.spi.Module;
import com.github.harbby.gadtry.spi.ModuleLoader;
import com.github.harbby.gadtry.spi.SecurityClassLoader;
import com.github.harbby.gadtry.spi.VolatileClassLoader;
import ideal.sylph.etl.Operator;
import ideal.sylph.etl.Plugin;
import ideal.sylph.etl.api.RealTimePipeline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public JobContainer createLocalContainer(Job job, String lastRunid)
}
System.out.print(line);
})
.notDepThisJvmClassPath()
.addUserjars(job.getDepends())
.notDependParentJvmClassPath()
.addUserJars(job.getDepends())
.build();
YarnConfiguration yarnConfiguration = injector.getInstance(YarnConfiguration.class);
return new LocalContainer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package ideal.sylph.runner.flink;

import com.github.harbby.gadtry.collection.ImmutableList;
import com.github.harbby.gadtry.easyspi.DirClassLoader;
import com.github.harbby.gadtry.ioc.IocFactory;
import com.github.harbby.gadtry.spi.DynamicClassLoader;
import ideal.sylph.runner.flink.engines.FlinkMainClassEngine;
import ideal.sylph.runner.flink.engines.FlinkStreamEtlEngine;
import ideal.sylph.runner.flink.engines.FlinkStreamSqlEngine;
Expand Down Expand Up @@ -69,8 +69,8 @@ public void initialize(RunnerContext context)

final ClassLoader classLoader = this.getClass().getClassLoader();

if (classLoader instanceof DirClassLoader) {
((DirClassLoader) classLoader).addDir(new File(flinkHome, "lib"));
if (classLoader instanceof DynamicClassLoader) {
((DynamicClassLoader) classLoader).addDir(new File(flinkHome, "lib"));
}
IocFactory injector = IocFactory.create(binder -> {
binder.bind(FlinkMainClassEngine.class).withSingle();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ private static JobGraph compile(String jobId, StringFlow flow, FlinkJobConfig jo
return getJobGraphForJarClass(execEnv, mainClass, new String[0]);
})
.setClassLoader(classLoader)
.addUserjars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserjars(pluginJars)
.addUserJars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserJars(pluginJars)
.build();

return launcher.startAndGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ private static JobGraph compile(String jobId, EtlFlow flow, FlinkJobConfig jobCo
return streamGraph.getJobGraph();
})
.setConsole((line) -> System.out.print(new Ansi().fg(YELLOW).a("[" + jobId + "] ").fg(GREEN).a(line).reset().toString()))
.addUserjars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserjars(pluginJars)
.addUserJars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserJars(pluginJars)
.setClassLoader(classLoader)
.build();
return launcher.startAndGet(); //setJobConfig(jobGraph, jobConfig, jobClassLoader, jobId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ private static JobGraph compile(
return streamGraph.getJobGraph();
})
//.notDepThisJvmClassPath() //todo: filter web rest jars 应避免构建作业时平台依赖混入
.addUserjars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserjars(pluginJars)
.addUserJars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserJars(pluginJars)
.setClassLoader(classLoader)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ public UnaryOperator<Dataset<Row>> loadSink(String driverStr, Map<String, Object
return 1;
})
.setConsole((line) -> System.out.print(new Ansi().fg(YELLOW).a("[" + jobId + "] ").fg(GREEN).a(line).reset()))
.addUserjars(ImmutableList.copy(classLoader.getURLs()))
.addUserjars(pluginJars)
.notDepThisJvmClassPath()
.addUserJars(ImmutableList.copy(classLoader.getURLs()))
.addUserJars(pluginJars)
.notDependParentJvmClassPath()
.setClassLoader(classLoader)
.build();
launcher.startAndGet();
Expand Down Expand Up @@ -128,9 +128,9 @@ static Serializable build1xJob(String jobId, EtlFlow flow, List<URL> pluginJars,
return 1;
})
.setConsole((line) -> System.out.print(new Ansi().fg(YELLOW).a("[" + jobId + "] ").fg(GREEN).a(line).reset()))
.addUserjars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserjars(pluginJars)
.notDepThisJvmClassPath()
.addUserJars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserJars(pluginJars)
.notDependParentJvmClassPath()
.setClassLoader(classLoader)
.build();
launcher.startAndGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public JobContainer createLocalContainer(Job job, String lastRunid)
}
System.out.print(line);
})
.notDepThisJvmClassPath()
.addUserjars(job.getDepends())
.notDependParentJvmClassPath()
.addUserJars(job.getDepends())
.build();

return new LocalContainer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ private static Serializable compile(String jobId, StringFlow flow, List<URL> plu
return "";
})
.setClassLoader(classLoader)
.addUserjars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserjars(pluginJars)
.addUserJars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserJars(pluginJars)
.build();

launcher.startAndGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package ideal.sylph.runner.spark;

import com.github.harbby.gadtry.easyspi.DirClassLoader;
import com.github.harbby.gadtry.ioc.IocFactory;
import com.github.harbby.gadtry.spi.DynamicClassLoader;
import ideal.sylph.spi.Runner;
import ideal.sylph.spi.RunnerContext;
import ideal.sylph.spi.job.ContainerFactory;
Expand Down Expand Up @@ -45,8 +45,8 @@ public void initialize(RunnerContext context)

ClassLoader classLoader = this.getClass().getClassLoader();

if (classLoader instanceof DirClassLoader) {
((DirClassLoader) classLoader).addDir(new File(sparkHome, "jars"));
if (classLoader instanceof DynamicClassLoader) {
((DynamicClassLoader) classLoader).addDir(new File(sparkHome, "jars"));
}

IocFactory injector = IocFactory.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ private static Serializable compile(String jobId, SqlFlow sqlFlow, OperatorMetaD
appGetter.get();
return true;
})
.addUserjars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserjars(pluginJars)
.addUserJars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserJars(pluginJars)
.setClassLoader(classLoader)
.notDepThisJvmClassPath()
.notDependParentJvmClassPath()
.build();

launcher.startAndGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ private static Serializable compile(String jobId, SqlFlow sqlFlow,
appGetter.get();
return true;
})
.addUserjars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserjars(pluginJars)
.addUserJars(ImmutableList.copy(classLoader.getURLs())) //flink jars + runner jar
.addUserJars(pluginJars)
.setClassLoader(classLoader)
.notDepThisJvmClassPath()
.notDependParentJvmClassPath()
.build();

launcher.startAndGet();
Expand Down
2 changes: 1 addition & 1 deletion sylph-spi/src/main/java/ideal/sylph/spi/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package ideal.sylph.spi;

import com.github.harbby.gadtry.collection.ImmutableList;
import com.github.harbby.gadtry.easyspi.VolatileClassLoader;
import com.github.harbby.gadtry.spi.VolatileClassLoader;
import ideal.sylph.etl.Operator;
import ideal.sylph.spi.job.ContainerFactory;
import ideal.sylph.spi.job.JobEngineHandle;
Expand Down
2 changes: 1 addition & 1 deletion sylph-spi/src/main/java/ideal/sylph/spi/SylphContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package ideal.sylph.spi;

import com.github.harbby.gadtry.easyspi.Module;
import com.github.harbby.gadtry.spi.Module;
import ideal.sylph.etl.Plugin;
import ideal.sylph.spi.job.JobContainer;
import ideal.sylph.spi.job.JobStore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package ideal.sylph.controller.action;

import com.github.harbby.gadtry.collection.MutableMap;
import com.github.harbby.gadtry.easyspi.Module;
import com.github.harbby.gadtry.spi.Module;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import ideal.sylph.etl.Plugin;
Expand Down

0 comments on commit 185c9ed

Please sign in to comment.