text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>rNode(new ResourceID(podName)));
}
private void handlePodEventsInMainThread(List<KubernetesPod> pods) {
getMainThreadExecutor()
.execute(
() -> {
for (KubernetesPod pod : pods) {
if (pod.isTerminated()) {
onPodTerminated(pod);
} else if (pod.isScheduled()) {
onPo... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>S IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.kubernetes.configuration;
import org.apache.flink.annotation.Internal;
import org... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>l &&
Arrays.stream(KubernetesDeploymentTarget.values())
.anyMatch(kubernetesDeploymentTarget -> kubernetesDeploymentTarget.name.equalsIgnoreCase(configValue));
}
private static KubernetesDeploymentTarget getFromName(final String deploymentTarget) {
if (deploymentTarget == null) {
return ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ate final String clusterId;
private final Time podCreationRetryInterval;
@Nullable
private final String webInterfaceUrl;
public KubernetesResourceManagerDriverConfiguration(String clusterId,
Time podCreationRetryInterval,
@Nullable String webInterfaceUrl) {
this.cluste... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>adConfiguration(dynamicParameters);
PackagedProgram program = null;
try {
//获取到作业信息(jar、参数、启动 main 类)
program = getPackagedProgram(configuration);
} catch (Exception e) {
LOG.error("Could not create application program.", e);
System.exit(1);
}
try {
//配置读取到的配置
configureExecut... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>etwork(configuration)) {
configuration.setString(RestOptions.BIND_PORT, "0");
configuration.setInteger(JobManagerOptions.PORT, 0);
configuration.setString(BlobServerOptions.PORT, "0");
configuration.setString(HighAvailabilityOptions.HA_JOB_MANAGER_PORT_RANGE, "0");
configuration.setString(T... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache<|fim_suffix|>utors;
import org... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>uration configuration) {
return new KubernetesSessionClusterExecutor();
}
}
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright owne... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE f<|fim_suffix|>garding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compli... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>
public void close() {
if (!running) {
return;
}
running = false;
LOG.info("Stopping {}.", this);
synchronized (watchLock) {
if (kubernetesWatch != null) {
kubernetesWatch.close();
}
}
}
private class ConfigMapCallbackHandlerImpl implements FlinkKubeClient.WatchCallbackHandle... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>etKeyForJobId(JobID jobId) {
return RUNNING_JOBS_REGISTRY_KEY_PREFIX + jobId.toString();
}
}
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regard... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ww.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governi... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ype =
KubernetesConfigOptions.ServiceExposedType.valueOf(externalService.getSpec().getType());
switch (externalServiceType) {
case ClusterIP:
case LoadBalancer:
return externalServicePort.getPort();
case NodePort:
return externalServicePort.getNodePort();
default:
throw new R... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>Watch the ConfigMaps with specified name and do the {@link WatchCallbackHandler}.
*
* @param name name to filter the ConfigMaps to watch
* @param callbackHandler callbackHandler which reacts to ConfigMap events
* @return Return a watch for ConfigMaps. It needs to be closed after use.
*/
Kuberne... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>nfiguration and IO executor.
*/
FlinkKubeClient fromConfiguration(Configuration configuration, Executor ioExecutor);
}
<|fim_prefix|>/*
* Licensed to the Apache Software F<|fim_middle|>oundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this wo... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for ad<|fim_suffix|>
public List<HasMetadata> buildAccompanyingKubernetesResources() throws IOException {
return Collections.emptyList();
}
}
<... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ecorateFlinkPod(FlinkPod flinkPod) {
final Container basicMainContainer = new ContainerBuilder(flinkPod.getMainContainer())
.addAllToEnv(getSecretEnvs())
.build();
return new FlinkPod.Builder(flinkPod)
.withMainContainer(basicMainContainer)
.build();
}
private List<EnvVar> getSecretEnv... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>e and mount a dedicated ConfigMap containing the custom Hive configuration from a local directory
* specified via the HIVE_CONF_DIR or HIVE_HOME environment variable.
*/
public class HiveConfMountDecorator extends AbstractKubernetesStepDecorator {
private static final Logger LOG = LoggerFactory.get... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ner = decorateMainContainer(flinkPod.getMainContainer());
return new FlinkPod.Builder(flinkPod)
.withPod(basicPod)
.withMainContainer(basicMainContainer)
.build();
}
private Container decorateMainContainer(Container container) {
//JM 资源描述
final ResourceRequirements requirements = Kubern... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ateJvmParametersStr(jobManagerProcessSpec, flinkConfig);
final String dynamicParameters = JobManagerProcessUtils.generateDynamicConfigsStr(jobManagerProcessSpec);
return KubernetesUtils.getCommonStartCommand(
flinkConfig,
KubernetesUtils.ClusterComponent.JOB_MANAGER,
jvmMemOpts,
configDire... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>sTaskManagerParameters kubernetesTaskManagerParameters) {
this.kubernetesTaskManagerParameters = checkNotNull(kubernetesTaskManagerParameters);
}
@Override
public FlinkPod decorateFlinkPod(FlinkPod flinkPod) {
final Container mainContainerWithStartCmd = new ContainerBuilder(flinkPod.getMainContain... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>erParameters.getReplicas())
.editOrNewTemplate()
.withMetadata(resolvedPod.getMetadata())
.withSpec(resolvedPod.getSpec())
.endTemplate()
.editOrNewSelector()
.addToMatchLabels(labels)
.endSelector()
.endSpec()
.build();
}
}
<|fim_prefix|>/*
* Licensed to the Apac... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright o<|fim_suffix|>, cause);
}
}
<|fim_middle|>wnership. The ASF licenses this file
* to you under... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> org.apache.flink.kubernetes.kubeclient.resources;
import io.fabric8.kubernetes.client.NamespacedKubernetesClient;
import io.fabric8.kubernetes.client.extended.leaderelection.LeaderCallbacks;
import io.fabric8.kubernetes.client.extended.leaderelection.LeaderElectionConfig;
import io.fabric8.kubernetes.cl... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ions().stream()
.anyMatch(
e ->
Objects.equals(e.getType(), "PodScheduled")
&& Objects.equals(e.getStatus(), "True"));
}
return false;
}
public String getTerminatedDiagnostics() {
final StringBuilder sb = new StringBuilder();
sb.append("Pod terminated, container terminatio... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation <|fim_suffix|> writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limit... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>* limitations under the License.
*/
package org.apache.flink.kubernetes.kubeclient.resources;
import io.fabric8.kubernetes.api.model.Toleration;
import io.fabric8.kubernetes.api.model.TolerationBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
/**
* Represent To... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>arding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.kubernetes.kubeclient.resou... | fim | zhisheng17/flink-learning | java |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contri<|fim_suffix|>;
public static final String ENV_FLINK_HOST_IP_ADDRESS = "_HOST_IP_ADDRESS";
public static final String POD_IP_FIELD_PATH = "status.podIP";
public static final String HOST_IP_FIELD_PATH = "status.hostIP";... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "L... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ingleOutputStreamOperator<MetricEvent> machineData = env.addSource(consumer)
.assignTimestampsAndWatermarks(new MetricWatermark());
AsyncDataStream.unorderedWait(machineData, new AlertRuleAsyncIOFunction(), 10000, TimeUnit.MICROSECONDS, 100)
.map(metricEvent -> {
... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> out.collect(value);
}
}
}
@Override
public void processBroadcastElement(List<AlertRule> value, Context ctx, Collector<MetricEvent> out) throws Exception {
if (value ... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>package com.zhisheng.alert.alert;
import com.zhisheng.common.model.LogEvent;
import com.zhisheng.common.schemas.LogSchema;
import com.zhisheng.common.utils.ExecutionEnvUtil;
import com.zhisheng.common.utils.KafkaConfigUtil;
import org.apach<|fim_suffix|>l.prepare(parameterTool);
Properties prope... | fim | zhisheng17/flink-learning | java |
package com.zhisheng.alert.alert;
import com.google.common.collect.Maps;
import com.zhisheng.alert.function.OutageProcessFunction;
import com.zhisheng.alert.model.AlertEvent;
import com.zhisheng.alert.model.OutageMetricEvent;
import com.zhisheng.alert.watermark.OutageMetricWaterMark;
import com.zhisheng.common.model.M... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> log.error("-----------mysql get connection has exception , msg = {}", e.getMessage());
}
return con;
}
}
<|fim_prefix|>package com.zhisheng.alert.function;
import com.zhisheng.common.model.MetricEvent;
import lombok.extern.slf4j.Slf4j;
import org.apache.flink.api.java.utils.... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver");
//注意,替换成自己本地的 mysql 数据库地址和用户名、密码
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8", "root", "root123456");
} catch (Exce... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>currentTimeMillis());
}
if (recover.value() != null && !recover.value() && outageMetricEvent.getTimestamp() > current.getTimestamp()) {
OutageMetricEvent recoverEvent = new OutageMetricEvent(outageMetricEvent.getClusterName(), outageMetricEvent.getHostIp(),
... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ing type;
private MetricEvent metricEvent;
private boolean recover;
private Long trigerTime;
private Long recoverTime;
}<|fim_prefix|>package com.zhisheng.alert.model;
import com.zhisheng.common.model.MetricEvent;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>ng thresholds;
}<|fim_prefix|>package com.zhisheng.alert.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Desc: alert rule
* Created by zhisheng on 2019/10/16 下午5:07
* blog:http://www.54tianzhisheng.cn/
* 微信公众号:zhisheng
*/
@D... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>package com.zhisheng.alert.model;
import lombok.Data;
import java.util.List;
/**
* @
* blog:http://www.54tianzhisheng.cn/
* 微信公众号:zhisheng
*/
@Data
public class AtMobiles {
/**
* 被@人的手机号
*
* @return
*/
public List<String> atMobiles;
/**
*<|fim_suffix|>oolean is... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>package com.zhisheng.alert.model;
import java.io.Serializable;
/**
* 请求消息的抽象类
* blog:http://www.54tianzhisheng.cn/
* 微信公众号:zhisheng
*/
public abstract class BaseMessage implements <|fim_suffix|>return msgtype;
}
/**
* 初始化 MessageType 方法
*/
protected abstract void init();
}
<|f... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>bok.Data;
import lombok.NoArgsConstructor;
import java.io.File;
import java.util.Map;
import java.util.Set;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Email {
/**
* 收件人
*/
private Set<String> to;
/**
* 邮件主题
*/
private String subject;
/**
* 邮件... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> */
private String title;
/**
* 封面图片URL
*/
private String picUrl;
/**
* 消息跳转URL
*/
private String messageUrl;
}
}
<|fim_prefix|>package com.zhisheng.alert.model;
import lombok.AllArgsConstructor;
import lombok.Data;
... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>package com.zhisheng.alert.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* markdown 类型钉钉消息
* blog:http://www.54tianzhisheng.cn/
* 微信公众号:zhisheng
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MarkDownMessage extends BaseMessage {
... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> * MarkDown类型
*/
markdown,
/**
* 跳转卡片类型
*/
actionCard,
/**
* 消息卡片类型
*/
feedCard;
}
<|fim_prefix|>package com.zhisheng.alert.model;
/**
* 消息类型:文本、链接、MarkDown、跳转卡片、消息卡片五种枚举值
* blog:http://www.54tianzhisheng.cn/
* 微信公众号:zhisheng
*/
public enum MessageTy... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> if (fields.containsKey(USED_PERCENT)) {
outageMetricEvent.setMemUsedPercent((Double) fields.get(USED_PERCENT));
}
break;
case LOAD:
if (fields.containsKey(LOAD5)) {
outageMetricEvent.setLoad5((Double) ... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> * @
*/
public AtMobiles at;
@Override
protected void init() {
this.msgtype = MessageType.text;
}
@Data
public static class TextContent {
/**
* 消息内容
*/
private String content;
}
}
<|fim_prefix|>package com.zhisheng.alert.m... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>pac<|fim_suffix|> */
private String dept_id_list;
/**
* 是否发送给所有
*/
private Boolean to_all_user;
/**
* 消息体
*/
private Msg msg;
@Data
@AllArgsConstructor
public static class Msg {
/**
* 消息类型
*/
private String msgtyp... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>tpclient do get request exception , msg = {}, result = {}",
Throwables.getStackTraceAsString(e), result);
}
} else {
accessToken = dingDingAccessTocken;
}
return accessToken;
}
}
<|fim_prefix|>package com.zhisheng.alert.utils;
i... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> * @param msgs 多条消息
*/
public static void sendDingDingMsg(List<String> urls, List<String> msgs) {
if (msgs == null || msgs.size() <= 0) {
log.warn("you may forget add notify msg");
return;
}
if (urls == null || urls.size() <= 0) {
log.w... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|> class DingDingWorkspaceNoticeUtil {
public static final String workNotifyUrl = "https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2?access_token=";
}
<|fim_prefix|>package com.zhisheng.alert.utils;
/**
* 钉钉工作通知工具类
* h<|fim_middle|>ttps://open-doc.dingtalk.com/microapp/servera... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>package com.zhisheng.alert.utils;
/**
* 邮件通知工具类
*/
public class Email<|fim_suffix|>oticeUtil {
}
<|fim_middle|>N<|endoftext|> | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>package co<|fim_suffix|>电话通知工具类
*/
public class PhoneNoticeUtil {
}
<|fim_middle|>m.zhisheng.alert.utils;
/**
* <|endoftext|> | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>package com.zhisheng.alert.utils;
/**
* 短信<|fim_suffix|>SMSNoticeUtil {
}
<|fim_middle|>通知工具类
*/
public class <|endoftext|> | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>rride
public long extractTimestamp(OutageMetricEvent outageMetricEvent, long l) {
long timestamp = outageMetricEvent.getTimestamp();
currentTimestamp = Math.max(timestamp, currentTimestamp);
return timestamp;
}
}
<|fim_prefix|>package com.zhisheng.a<|fim_middle|>lert.waterm... | fim | zhisheng17/flink-learning | java |
<|fim_prefix|>import com.zhisheng.common.model.LogEvent;
import com.zhisheng.common.utils.GsonUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import java.util.HashMap;
import java.util.Map;
import java.util.Propert... | fim | zhisheng17/flink-learning | java |
import com.zhisheng.common.model.MetricEvent;
import com.zhisheng.common.utils.GsonUtil;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import java.util.*;
/**
* Desc: build machine metric data
* Created by zhisheng on 2019/10/15 上午10:47
* blog:http... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>个钉钉地址发送多条消息
String text1 = "111111";
String text2 = "222222";
String text3 = "333333";
String text4 = "444444";
DingDingGroupMsgUtil.sendDingDingMsg("https://oapi.dingtalk.com/robot/send?access_token=32e9d99020641c46146174de1ea437fffb4122f957102078b3f1898009af7e40",... | fim | zhisheng17/flink-learning | java |
<|fim_suffix|>sDefFoundError: org/apache/flink/api/common/ExecutionConfig$GlobalJobParameters";
LogEvent event = new LogEvent().builder()
.type("app")
.timestamp(System.currentTimeMillis())
.level("error")
.message(message)
.tags(... | fim | zhisheng17/flink-learning | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.