./bin/flink run -p 10 ../examples/*WordCount-java*.jar 提交方式

Flink本地模式极简安装与开发环境搭建指南 分布式流处理框架Apache Flink作为实时计算领域的核心技术,其本地模式安装是开发者快速入门的关键步骤。从技术原理看,Flink通过JobManager和TaskManager的协同工作实现流批一体处理,这种架构设计使其在实时ETL、事件驱动应用等场景展现独特优势。本文以Java 11+环境为基础,详细介绍单机集群部署流程,包括安装包获取、配置文件调整、示例程序运行等核心环节,特别针对开发环境中常见的内存配置、端口冲突等问题提供解决方案。通过Web UI监控和CLI工具验证,开发者可以快速掌握Flin 阅读详情

聊聊flink的Parallel Execution

codecraft发表于码匠的流水账订阅

134

序

本文主要研究一下flink的Parallel Execution

实例

Operator Level

final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

DataStream<String> text = [...]
DataStream<Tuple2<String, Integer>> wordCounts = text
    .flatMap(new LineSplitter())
    .keyBy(0)
    .timeWindow(Time.seconds(5))
    .sum(1).setParallelism(5);

wordCounts.print();

env.execute("Word Count Example");
  • operators、data sources、data sinks都可以调用setParallelism()方法来设置parallelism

Execution Environment Level

final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(3);

DataStream<String> text = [...]
DataStream<Tuple2<String, Integer>> wordCounts = [...]
wordCounts.print();

env.execute("Word Count Example");
  • 在ExecutionEnvironment里头可以通过setParallelism来给operators、data sources、data sinks设置默认的parallelism;如果operators、data sources、data sinks自己有设置parallelism则会覆盖ExecutionEnvironment设置的parallelism

Client Level

./bin/flink run -p 10 ../examples/*WordCount-java*.jar

或者

try {
    PackagedProgram program = new PackagedProgram(file, args);
    InetSocketAddress jobManagerAddress = RemoteExecutor.getInetFromHostport("localhost:6123");
    Configuration config = new Configuration();

    Client client = new Client(jobManagerAddress, config, program.getUserCodeClassLoader());

    // set the parallelism to 10 here
    client.run(program, 10, true);

} catch (ProgramInvocationException e) {
    e.printStackTrace();
}
  • 使用CLI client,可以在命令行调用是用-p来指定,或者Java/Scala调用时在Client.run的参数中指定parallelism

System Level

# The parallelism used for programs that did not specify and other parallelism.

parallelism.default: 1
  • 可以在flink-conf.yaml中通过parallelism.default配置项给所有execution environments指定系统级的默认parallelism

ExecutionEnvironment

flink-java-1.7.1-sources.jar!/org/apache/flink/api/java/ExecutionEnvironment.java

@Public
public abstract class ExecutionEnvironment {
    //......

    private final ExecutionConfig config = new ExecutionConfig();

    /**
     * Sets the parallelism for operations executed through this environment.
     * Setting a parallelism of x here will cause all operators (such as join, map, reduce) to run with
     * x parallel instances.
     *
     * <p>This method overrides the default parallelism for this environment.
     * The {@link LocalEnvironment} uses by default a value equal to the number of hardware
     * contexts (CPU cores / threads). When executing the program via the command line client
     * from a JAR file, the default parallelism is the one configured for that setup.
     *
     * @param parallelism The parallelism
     */
    public void setParallelism(int parallelism) {
        config.setParallelism(parallelism);
    }

    @Internal
    public Plan createProgramPlan(String jobName, boolean clearSinks) {
        if (this.sinks.isEmpty()) {
            if (wasExecuted) {
                throw new RuntimeException("No new data sinks have been defined since the " +
                        "last execution. The last execution refers to the latest call to " +
                        "'execute()', 'count()', 'collect()', or 'print()'.");
            } else {
                throw new RuntimeException("No data sinks have been created yet. " +
                        "A program needs at least one sink that consumes data. " +
                        "Examples are writing the data set or printing it.");
            }
        }

        if (jobName == null) {
            jobName = getDefaultName();
        }

        OperatorTranslation translator = new OperatorTranslation();
        Plan plan = translator.translateToPlan(this.sinks, jobName);

        if (getParallelism() > 0) {
            plan.setDefaultParallelism(getParallelism());
        }
        plan.setExecutionConfig(getConfig());

        // Check plan for GenericTypeInfo's and register the types at the serializers.
        if (!config.isAutoTypeRegistrationDisabled()) {
            plan.accept(new Visitor<org.apache.flink.api.common.operators.Operator<?>>() {

                private final Set<Class<?>> registeredTypes = new HashSet<>();
                private final Set<org.apache.flink.api.common.operators.Operator<?>> visitedOperators = new HashSet<>();

                @Override
                public boolean preVisit(org.apache.flink.api.common.operators.Operator<?> visitable) {
                    if (!visitedOperators.add(visitable)) {
                        return false;
                    }
                    OperatorInformation<?> opInfo = visitable.getOperatorInfo();
                    Serializers.recursivelyRegisterType(opInfo.getOutputType(), config, registeredTypes);
                    return true;
                }

                @Override
                public void postVisit(org.apache.flink.api.common.operators.Operator<?> visitable) {}
            });
        }

        try {
            registerCachedFilesWithPlan(plan);
        } catch (Exception e) {
            throw new RuntimeException("Error while registering cached files: " + e.getMessage(), e);
        }

        // clear all the sinks such that the next execution does not redo everything
        if (clearSinks) {
            this.sinks.clear();
            wasExecuted = true;
        }

        // All types are registered now. Print information.
        int registeredTypes = config.getRegisteredKryoTypes().size() +
                config.getRegisteredPojoTypes().size() +
                config.getRegisteredTypesWithKryoSerializerClasses().size() +
                config.getRegisteredTypesWithKryoSerializers().size();
        int defaultKryoSerializers = config.getDefaultKryoSerializers().size() +
                config.getDefaultKryoSerializerClasses().size();
        LOG.info("The job has {} registered types and {} default Kryo serializers", registeredTypes, defaultKryoSerializers);

        if (config.isForceKryoEnabled() && config.isForceAvroEnabled()) {
            LOG.warn("In the ExecutionConfig, both Avro and Kryo are enforced. Using Kryo serializer");
        }
        if (config.isForceKryoEnabled()) {
            LOG.info("Using KryoSerializer for serializing POJOs");
        }
        if (config.isForceAvroEnabled()) {
            LOG.info("Using AvroSerializer for serializing POJOs");
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug("Registered Kryo types: {}", config.getRegisteredKryoTypes().toString());
            LOG.debug("Registered Kryo with Serializers types: {}", config.getRegisteredTypesWithKryoSerializers().entrySet().toString());
            LOG.debug("Registered Kryo with Serializer Classes types: {}", config.getRegisteredTypesWithKryoSerializerClasses().entrySet().toString());
            LOG.debug("Registered Kryo default Serializers: {}", config.getDefaultKryoSerializers().entrySet().toString());
            LOG.debug("Registered Kryo default Serializers Classes {}", config.getDefaultKryoSerializerClasses().entrySet().toString());
            LOG.debug("Registered POJO types: {}", config.getRegisteredPojoTypes().toString());

            // print information about static code analysis
            LOG.debug("Static code analysis mode: {}", config.getCodeAnalysisMode());
        }

        return plan;
    }

    //......
}
  • ExecutionEnvironment提供了setParallelism方法,给ExecutionConfig指定parallelism;最后createProgramPlan方法创建Plan后会读取ExecutionConfig的parallelism,给Plan设置defaultParallelism

LocalEnvironment

flink-java-1.7.1-sources.jar!/org/apache/flink/api/java/LocalEnvironment.java

@Public
public class LocalEnvironment extends ExecutionEnvironment {

    //......

    public JobExecutionResult execute(String jobName) throws Exception {
        if (executor == null) {
            startNewSession();
        }

        Plan p = createProgramPlan(jobName);

        // Session management is disabled, revert this commit to enable
        //p.setJobId(jobID);
        //p.setSessionTimeout(sessionTimeout);

        JobExecutionResult result = executor.executePlan(p);

        this.lastJobExecutionResult = result;
        return result;
    }

    //......
}
  • LocalEnvironment的execute调用的是LocalExecutor的executePlan

LocalExecutor

flink-clients_2.11-1.7.1-sources.jar!/org/apache/flink/client/LocalExecutor.java

public class LocalExecutor extends PlanExecutor {
    
    //......

    @Override
    public JobExecutionResult executePlan(Plan plan) throws Exception {
        if (plan == null) {
            throw new IllegalArgumentException("The plan may not be null.");
        }

        synchronized (this.lock) {

            // check if we start a session dedicated for this execution
            final boolean shutDownAtEnd;

            if (jobExecutorService == null) {
                shutDownAtEnd = true;

                // configure the number of local slots equal to the parallelism of the local plan
                if (this.taskManagerNumSlots == DEFAULT_TASK_MANAGER_NUM_SLOTS) {
                    int maxParallelism = plan.getMaximumParallelism();
                    if (maxParallelism > 0) {
                        this.taskManagerNumSlots = maxParallelism;
                    }
                }

                // start the cluster for us
                start();
            }
            else {
                // we use the existing session
                shutDownAtEnd = false;
            }

            try {
                // TODO: Set job's default parallelism to max number of slots
                final int slotsPerTaskManager = jobExecutorServiceConfiguration.getInteger(TaskManagerOptions.NUM_TASK_SLOTS, taskManagerNumSlots);
                final int numTaskManagers = jobExecutorServiceConfiguration.getInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 1);
                plan.setDefaultParallelism(slotsPerTaskManager * numTaskManagers);

                Optimizer pc = new Optimizer(new DataStatistics(), jobExecutorServiceConfiguration);
                OptimizedPlan op = pc.compile(plan);

                JobGraphGenerator jgg = new JobGraphGenerator(jobExecutorServiceConfiguration);
                JobGraph jobGraph = jgg.compileJobGraph(op, plan.getJobId());

                return jobExecutorService.executeJobBlocking(jobGraph);
            }
            finally {
                if (shutDownAtEnd) {
                    stop();
                }
            }
        }
    }

    //......
}
  • LocalExecutor的executePlan方法还会根据slotsPerTaskManager及numTaskManagers对plan设置defaultParallelism

RemoteEnvironment

flink-java-1.7.1-sources.jar!/org/apache/flink/api/java/RemoteEnvironment.java

@Public
public class RemoteEnvironment extends ExecutionEnvironment {

    //......

    public JobExecutionResult execute(String jobName) throws Exception {
        PlanExecutor executor = getExecutor();

        Plan p = createProgramPlan(jobName);

        // Session management is disabled, revert this commit to enable
        //p.setJobId(jobID);
        //p.setSessionTimeout(sessionTimeout);

        JobExecutionResult result = executor.executePlan(p);

        this.lastJobExecutionResult = result;
        return result;
    }

    //......
}
  • RemoteEnvironment的execute调用的是RemoteExecutor的executePlan

RemoteExecutor

flink-clients_2.11-1.7.1-sources.jar!/org/apache/flink/client/RemoteExecutor.java

public class RemoteExecutor extends PlanExecutor {

    private final Object lock = new Object();

    private final List<URL> jarFiles;

    private final List<URL> globalClasspaths;

    private final Configuration clientConfiguration;

    private ClusterClient<?> client;

    //......

    @Override
    public JobExecutionResult executePlan(Plan plan) throws Exception {
        if (plan == null) {
            throw new IllegalArgumentException("The plan may not be null.");
        }

        JobWithJars p = new JobWithJars(plan, this.jarFiles, this.globalClasspaths);
        return executePlanWithJars(p);
    }

    public JobExecutionResult executePlanWithJars(JobWithJars program) throws Exception {
        if (program == null) {
            throw new IllegalArgumentException("The job may not be null.");
        }

        synchronized (this.lock) {
            // check if we start a session dedicated for this execution
            final boolean shutDownAtEnd;

            if (client == null) {
                shutDownAtEnd = true;
                // start the executor for us
                start();
            }
            else {
                // we use the existing session
                shutDownAtEnd = false;
            }

            try {
                return client.run(program, defaultParallelism).getJobExecutionResult();
            }
            finally {
                if (shutDownAtEnd) {
                    stop();
                }
            }
        }
    }

    //......
}
  • RemoteExecutor的executePlan调用了executePlanWithJars方法,而后者则调用了ClusterClient的run,并在参数中指定了defaultParallelism

ClusterClient

flink-clients_2.11-1.7.1-sources.jar!/org/apache/flink/client/program/ClusterClient.java

public abstract class ClusterClient<T> {
    //......

    public JobSubmissionResult run(JobWithJars program, int parallelism) throws ProgramInvocationException {
        return run(program, parallelism, SavepointRestoreSettings.none());
    }

    public JobSubmissionResult run(JobWithJars jobWithJars, int parallelism, SavepointRestoreSettings savepointSettings)
            throws CompilerException, ProgramInvocationException {
        ClassLoader classLoader = jobWithJars.getUserCodeClassLoader();
        if (classLoader == null) {
            throw new IllegalArgumentException("The given JobWithJars does not provide a usercode class loader.");
        }

        OptimizedPlan optPlan = getOptimizedPlan(compiler, jobWithJars, parallelism);
        return run(optPlan, jobWithJars.getJarFiles(), jobWithJars.getClasspaths(), classLoader, savepointSettings);
    }

    private static OptimizedPlan getOptimizedPlan(Optimizer compiler, JobWithJars prog, int parallelism)
            throws CompilerException, ProgramInvocationException {
        return getOptimizedPlan(compiler, prog.getPlan(), parallelism);
    }

    public static OptimizedPlan getOptimizedPlan(Optimizer compiler, Plan p, int parallelism) throws CompilerException {
        Logger log = LoggerFactory.getLogger(ClusterClient.class);

        if (parallelism > 0 && p.getDefaultParallelism() <= 0) {
            log.debug("Changing plan default parallelism from {} to {}", p.getDefaultParallelism(), parallelism);
            p.setDefaultParallelism(parallelism);
        }
        log.debug("Set parallelism {}, plan default parallelism {}", parallelism, p.getDefaultParallelism());

        return compiler.compile(p);
    }

    //......
}
  • ClusterClient的run方法中的parallelism在parallelism > 0以及p.getDefaultParallelism() <= 0的时候会作用到Plan中

DataStreamSource

flink-streaming-java_2.11-1.7.1-sources.jar!/org/apache/flink/streaming/api/datastream/DataStreamSource.java

@Public
public class DataStreamSource<T> extends SingleOutputStreamOperator<T> {

    boolean isParallel;

    public DataStreamSource(StreamExecutionEnvironment environment,
            TypeInformation<T> outTypeInfo, StreamSource<T, ?> operator,
            boolean isParallel, String sourceName) {
        super(environment, new SourceTransformation<>(sourceName, operator, outTypeInfo, environment.getParallelism()));

        this.isParallel = isParallel;
        if (!isParallel) {
            setParallelism(1);
        }
    }

    public DataStreamSource(SingleOutputStreamOperator<T> operator) {
        super(operator.environment, operator.getTransformation());
        this.isParallel = true;
    }

    @Override
    public DataStreamSource<T> setParallelism(int parallelism) {
        if (parallelism != 1 && !isParallel) {
            throw new IllegalArgumentException("Source: " + transformation.getId() + " is not a parallel source");
        } else {
            super.setParallelism(parallelism);
            return this;
        }
    }
}
  • DataStreamSource继承了SingleOutputStreamOperator,它提供了setParallelism方法,最终调用的是父类SingleOutputStreamOperator的setParallelism

SingleOutputStreamOperator

flink-streaming-java_2.11-1.7.1-sources.jar!/org/apache/flink/streaming/api/datastream/SingleOutputStreamOperator.java

@Public
public class SingleOutputStreamOperator<T> extends DataStream<T> {
    //......

    /**
     * Sets the parallelism for this operator.
     *
     * @param parallelism
     *            The parallelism for this operator.
     * @return The operator with set parallelism.
     */
    public SingleOutputStreamOperator<T> setParallelism(int parallelism) {
        Preconditions.checkArgument(canBeParallel() || parallelism == 1,
                "The parallelism of non parallel operator must be 1.");

        transformation.setParallelism(parallelism);

        return this;
    }

    //......
}
  • SingleOutputStreamOperator的setParallelism最后是作用到StreamTransformation

DataStreamSink

flink-streaming-java_2.11-1.7.1-sources.jar!/org/apache/flink/streaming/api/datastream/DataStreamSink.java

@Public
public class DataStreamSink<T> {

    private final SinkTransformation<T> transformation;

    //......

    /**
     * Sets the parallelism for this sink. The degree must be higher than zero.
     *
     * @param parallelism The parallelism for this sink.
     * @return The sink with set parallelism.
     */
    public DataStreamSink<T> setParallelism(int parallelism) {
        transformation.setParallelism(parallelism);
        return this;
    }

    //......
}
  • DataStreamSink提供了setParallelism方法,最后是作用于SinkTransformation

小结

  • flink可以设置好几个level的parallelism,其中包括Operator Level、Execution Environment Level、Client Level、System Level
  • 在flink-conf.yaml中通过parallelism.default配置项给所有execution environments指定系统级的默认parallelism;在ExecutionEnvironment里头可以通过setParallelism来给operators、data sources、data sinks设置默认的parallelism;如果operators、data sources、data sinks自己有设置parallelism则会覆盖ExecutionEnvironment设置的parallelism
  • ExecutionEnvironment提供的setParallelism方法用于给ExecutionConfig指定parallelism(如果使用CLI client,可以在命令行调用是用-p来指定,或者Java/Scala调用时在Client.run的参数中指定parallelism;LocalEnvironment及RemoteEnvironment设置的parallelism最后都是设置到Plan中);DataStreamSource继承了SingleOutputStreamOperator,它提供了setParallelism方法,最终调用的是父类SingleOutputStreamOperator的setParallelism;SingleOutputStreamOperator的setParallelism最后是作用到StreamTransformation;DataStreamSink提供了setParallelism方法,最后是作用于SinkTransformation

doc

  • Parallel Execution

本文分享自微信公众号 - 码匠的流水账(geek_luandun)

原文出处及转载信息见文内详细说明,如有侵权,请联系 yunjia_community@tencent.com 删除。

原始发表时间:2019-02-12

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于 2019-03-04

编程算法

举报

30

分享

  •  

  •  
  •  
  •  

扫描二维码

 

 

码匠的流水账

1170 篇文章52 人订阅

订阅专栏

Flink 1.18.0 本地模式部署:Ubuntu/WSL/Cygwin 3环境实测与排错指南 本文详细介绍了Flink 1.18.0在Ubuntu、WSL和Cygwin三种环境下的本地模式部署方法,包括环境准备、安装步骤、常见问题排查及优化配置。通过对比分析各环境特性,为开发者提供选型建议,帮助快速搭建稳定的Flink开发测试环境。 阅读详情

相关推荐

Flink部署模式全解析:从本地单机到YARN集群的实战指南

实时计算作为大数据处理的核心技术,其核心在于高效、低延迟地处理无界数据流。Apache Flink作为业界领先的流处理框架,其部署模式的选择直接决定了系统的资源利用率、运维复杂度和扩展性。理解其部署原理,对于构建稳定可靠的实时数据管道至关重要。从最基础的本地单机模式入手,开发者可以快速验证业务逻辑;而Standalone集群模式则为中小规模场景提供了独立可控的部署方案。在生产环境中,基于YARN的部署模式能够无缝融入现有Hadoop生态,实现资源的弹性调度与高效管理,这是构建企业级实时计算平台的关键技术实践

weixin_30859423的博客 470

聊聊flink的Parallel Execution

序 本文主要研究一下flink的Parallel Execution 实例 Operator Level final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); DataStream&lt;String&gt; text = [...] DataStream&lt;T...

weixin_33969116的博客 457

Flink 1.18.0 本地模式部署:Ubuntu/WSL/Cygwin 3种环境实测与排错指南

本文详细介绍了Flink 1.18.0在Ubuntu、WSL和Cygwin三种环境下的本地模式部署方法,包括安装步骤、常见问题排查及优化建议。针对不同环境特性提供实测对比,帮助开发者快速搭建高效的Flink开发测试环境,特别适合需要本地调试和性能优化的场景。

com_xpp的专栏 619

Flink学习笔记之流处理核心编程--数据源读取(Source)

本篇博客主要是写了如何从不同的数据源里读取数据,包括Flink从Java集合中读取数据、从本地文件当中读取数据、从Socket读取数据、从Kafka读取数据、从自定义Source获取数据。

qq_43224174的博客 1665

Flink三大部署模式详解:Local、Standalone与YARN

分布式流处理框架Apache Flink的部署模式选择直接影响系统性能和运维效率。从技术原理看,流处理系统需要解决低延迟、高吞吐和精确一次处理等核心问题,而不同部署模式在资源管理、隔离性和容错机制上存在显著差异。Local模式通过单JVM多线程模拟分布式环境,适合开发调试;Standalone模式利用Flink内置调度器实现轻量级集群部署;YARN模式则依托Hadoop生态实现动态资源分配。在生产环境中,YARN模式凭借其与HDFS的深度集成和资源隔离能力,成为处理PB级数据的首选方案。本文重点解析这三种模

weixin_34032621的博客 439

【Flink】The parallelism of non parallel operator must be 1

flink学习过程中遇到The parallelism of non parallel operator must be 1问题 Exception in thread "main" java.lang.IllegalArgumentException: The parallelism of non parallel operator must be 1. at org.apache.flink.util.Preconditions.checkArgument(Preconditions.jav...

一杯咖啡半杯糖的博客 2007

【Flink】DataStream API使用之源算子(Source)

一般将数据的输入来源称为数据源(data source),而读取数据的算子就叫做源算子(source operator)。所以,Source就是整个程序的输入端。 Flink中添加source的方式,是调用执行环境的 addSource()方法:

菜鸟sdut的博客 2414

Ambari 3.0+BigTop 3.3集群部署实战

Ambari 3.0+BigTop 3.3集群部署

docsz的博客 631

【Flink(Apache Flink)】Flink入门及获取数据、实现多并行度

Flink(Apache Flink)是一个流式处理和批处理的开源框架,用于高性能、可伸缩的数据流处理。它提供了强大的数据流处理能力,适用于实时数据分析、事件驱动应用和大规模数据处理。 本教程包括以下内容:Flink环境配置与运行、获取数据[自定义读取kafka数据/使用官方组件读取]、实现多并行度。

qq_47450919的博客 1204

对计算机专业来说学历真的重要吗?

我本科学校是渣渣二本,研究生学校是985,现在毕业五年,校招笔试、面试,社招面试参加了两年了,就我个人的经历来说下这个问题。 这篇文章很长,但绝对是精华,相信我,读完以后,你会知道学历不好的解决方案,记得帮我点赞哦。 先说结论,无论赞不赞同,它本质就是这样:对于技术类工作而言,学历五年以内非常重要,但有办法弥补。五年以后,不重要。 目录: 张雪峰讲述的事实 我看到的事实 为什么会这样 ...

启舰 55万+

TASK02【datawhale组队学习】视觉感知与手眼协调,计算机视觉在机器人中应用,手眼标定算法实现,深度估计与3D重建

参考教程AI硬件与机器人技术教程:https://github.com/datawhalechina/ai-hardware-robotics视觉感知与手眼协调,计算机视觉在机器人中应用,手眼标定算法实现,深度估计与3D重建单目深度估计 (Monocular Depth Estimation)DPT 的全称是 Dense Prediction Transformer。

m0_52024881的博客 1194

从0到1搭建流处理平台:DoEKS集成Kafka与Flink最佳实践

DoEKS(Data on Amazon EKS)是一款功能强大的工具,能够帮助用户在Amazon EKS上轻松构建、部署和扩展数据平台。本文将详细介绍如何利用DoEKS集成Kafka与Flink,从0到1搭建一个高效的流处理平台,为新手和普通用户提供专业易懂的操作指南。 ## 流处理平台搭建准备工作 在开始搭建流处理平台之前,需要确保已经完成以下准备工作: - 部署Flink on EKS

gitblog_00398的博客 288

ADS仿真过孔阻抗(via designer)

目录一、将PCB层叠导入ADS(个人习惯)二、过孔的参数化设置三、过孔的仿真四、仿真结果查看五、导出仿真结果和模型六、过孔的经验法则欢迎交流,欢迎转载,转载请注明出处~ 工具:Via Designer Via Designer 调用的是ADS EMPro 仿真引擎,采用的FEM(三维全波有限元法)。 优点: 1、利用ADS已经做好的参数化和流程化的设计,不需要工程师完成过孔的建模这一繁琐的过程。 2、可以输出EMmodule 完成原理图协仿真。 一、将PCB层叠导入ADS(个人习惯) 个人认为在ADS中设置

luohuo9844的博客 1万+

单机部署Hadoop+Spark+Flink:本地大数据环境搭建与核心功能验证

大数据处理的核心在于对海量、多样、高速数据进行高效分析与价值挖掘,其技术基石通常包括分布式存储与计算框架。通过容器化技术,我们可以在单机环境下模拟完整的分布式处理流程,这为学习、开发和原型验证提供了极大便利。本文聚焦于利用Docker Compose一键部署集成Hadoop、Spark和Flink的轻量化环境,详细阐述了从环境准备、服务启动到核心功能测试的完整路径。实践环节覆盖了HDFS文件操作、Spark批处理任务提交以及Flink流处理管道的验证,并探讨了通过REST API进行任务管理的方法。这种本地

weixin_33912246的博客 377

ROS2机械臂实战:从基础控制到视觉抓取

本文详细介绍了ROS2机械臂从仿真环境搭建到视觉抓取的全流程实战指南。内容涵盖使用Gazebo搭建仿真环境、编写基础控制节点、集成视觉感知进行目标检测与坐标变换,并设计状态机逻辑实现自动化抓取。通过系统集成与联调,帮助开发者掌握ROS2机械臂开发的核心技能。

weixin_29197699的博客 460

Flink部署模式全解析:从本地单机到YARN集群实战指南

在实时数据处理领域,Apache Flink作为流计算引擎的核心,其部署模式的选择直接影响着作业的稳定性和资源利用率。理解其部署原理,关键在于掌握不同资源管理抽象层:本地模式适用于快速调试,Standalone模式提供独立集群管理,而YARN模式则实现了与Hadoop生态的资源统一调度。从技术价值看,合理的部署方案能有效平衡开发效率、运维复杂度与集群资源利用率,尤其在生产环境中,结合高可用配置与状态后端优化,是保障流处理作业7x24小时稳定运行的基础。本文聚焦Flink的多种部署模式,通过对比Standal

weixin_34414196的博客 431

【原创,解决CLodop安装后无法调用的问题】已经安装过CLodop,但是网页上仍然提示“clodop云打印服务(localhost本地)未安装启动,点击这里执行安装....”

在某些国内web网站中,需要安装一个名为“CLodop”的插件;但在实际使用过程中,即使安装了CLodop插件,网页试图调用它时还是会提示“clodop云打印服务(localhost本地)未安装启动,点击这里执行安装...”,且无法完成相关打印任务 本文属原创博客,分析了解决CLodop无法被调用的问题,并附上了原理和解决方法,本质上是和跨域请求以及CORS类安全组策略相关

link_in_csdn的博客 2万+

Flink任务报错记录

1、报错信息如下 org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: Zero-length character strings have no serializable string representation. at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProg.

zwahut的专栏 2385

Dify 平台中实现多个智能体之间互相通信

Dify 中的 API 工具通过 LLM 的工具使用能力,连接不同 Dify 应用或外部服务,实现智能体间的协作。其核心流程包括意图识别、参数提取、工具调用、响应反馈及最终答案生成。为优化调用,建议设计结构化 API 响应、明确工具描述与参数定义,并在 Prompt 中引导工具使用。此外,可通过链式调用或广播模式处理复杂请求,实现多智能体协同工作。对于耗时任务,可考虑轮询机制以避免长时间等待。

形上得其象,形下合于数;阴阳自济,玄理自明。 1529

ESP32S3接入讯飞在线语音识别教程及配套源代码

本文介绍了如何使用ESP32-S3开发板实现讯飞在线语音识别功能。首先,需要准备硬件设备,包括ESP32-S3开发板、麦克风模块、MicroSD卡模块和扬声器模块。接着,安装Arduino IDE并配置ESP32-S3开发环境,注册讯飞开放平台账号并获取API凭证。然后,通过I2S接口连接麦克风模块,并编写代码实现语音录制、Base64编码、API请求和识别结果处理。代码包括初始化WiFi、麦克风、系统时间,以及录制语音、发送请求、解析响应等功能。最后,通过按键触发录音,并将识别结果输出到串口。

2401_88800025的博客 750

【深入浅出flink】第9篇:详细解读flink中GlobalWindows、window、windowAll的区别与联系

刚学习flink的同学可能会有疑惑,GlobalWindows、window、windowAll到底有什么关系?GlobalWindows和windowAll的并行度都是1吗?window和windowAll的区别是什么?看了这篇文章,你将完全明白它们之间的区别与联系。

雷恩Layne 6988

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Flink DataStream API (五)Flink 自定义 Source

文章目录 大多数情况下,前面的数据源已经能够满足需要。但是凡事总有例外,如果遇到特殊情况,我们想要读取的数据源来自某个外部系统,而 flink 既没有预实现的方法、也没有提供连接器,又该怎么办呢? 那就只好自定义实现 SourceFunction 了。主要重写两个关键方法:run()和 cancel()。 run()方法:使用运行时上下文对象(SourceContext)向下游发送数据; cancel()方法:通过标识位控制退出循环,来达到中断数据源的效果。 自定义一下数据源:自定义数据源代码 下面的代

weixin_45417821的博客 782

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

4、如何在flink任务中读取外部数据源(DataStream API)

用一个例子告诉你 怎样在Flink DataStream API 中读取数据源(Scala API)

向热爱自己一样,热爱这个世界。 2908

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

flink 1.12 批处理读写hive基础教程

flink 1.12批量读写hive基础教程

u012447842的博客 6602
上一篇: 反射解析数据格式
下一篇: JAVA多线程读写文件如何做到线程安全?(文件锁,FileChannel)
王树民
博客等级 码龄10年 912粉丝 560原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址