美文网首页
ARTS-第六周

ARTS-第六周

作者: 梧上擎天 | 来源:发表于2019-03-25 10:23 被阅读0次

Algorithm

二叉树根据值删除节点


    public void remove(E e) {
        root = remove(root, e);
    }

    private Node remove(Node node, E e) {
        if (node == null) {
            return null;
        }
        if (e.compareTo(node.e) < 0) {
            node.left = remove(node.left,e);
            return node;
        }else if (e.compareTo(node.e) > 0){
            node.right = remove(node.right,e);
            return node;
        }else {
            if (node.left == null){
                Node rightNode = node.right;
                size--;
                node.right = null;
                return rightNode;
            }
            if (node.right == null){
                Node leftNode = node.left;
                size--;
                node.left = null;
                return leftNode;
            }
            Node successor = removeMin(node.right);
            successor.left = node.left;
            successor.right = node.right;
            node.left = node.right = null;
            return successor;

        }


    }

  public E removeMin() {
        E minnum = mininum();
        root = removeMin(root);
        return minnum;
    }

    private Node removeMin(Node node) {
        if (node.left == null) {
            Node childRight = node.right;
            node.right = null;
            size--;
            return childRight;

        }
        node.left = removeMin(node.left);
        return node;
    }
    
    

Review

Flink自定义TableSource和TableSink,官网地址

TableSource提供对存储在外部系统中的数据的访问,将外部存储读出数据并注册成Table,并可使用Table和SQL的api。

TableSource.png

TableSink向外部存储系统发送并保存数据。

TableSink.png

TableFactory 隔离用户使用和代码实现

TableFactory.png

Tips

一、Bahir

官网地址 http://bahir.apache.org/

Apache Bahir为多个分布式分析平台提供扩展,通过各种流连接器和SQL数据源扩展其功能。目前包括

Spark

  • Spark data source for Apache CouchDB/Cloudant
  • Spark Structured Streaming data source for Akka
  • Spark Structured Streaming data source for MQTT
  • Spark DStream connector for Apache CouchDB/Cloudant
  • Spark DStream connector for Akka
  • Spark DStream connector for Google Cloud Pub/Sub
  • Spark DStream connector for PubNub
  • Spark DStream connector for MQTT (new Sink)
  • Spark DStream connector for Twitter
  • Spark DStream connector for ZeroMQ (Enhanced Implementation)

Flink

  • Flink streaming connector for ActiveMQ
  • Flink streaming connector for Akka
  • Flink streaming connector for Flume
  • Flink streaming connector for InfluxDB
  • Flink streaming connector for Kudu
  • Flink streaming connector for Redis
  • Flink streaming connector for Netty

二、Flink其他连接器
Flink除了 kafka、文件系统、es其实还在源码中写了很多连接器,但都没有发布到maven 仓库中,如果想引用的话,需要指定apache的服务器


    <repositories>
        <repository>
            <id>apache.snapshots</id>
            <name>Apache Development Snapshot Repository</name>
            <url>https://repository.apache.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

Example mysql 和 hbase

 <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-jdbc_2.11</artifactId>
            <version>${flink.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-hbase_2.11</artifactId>
            <version>${flink.version}</version>
        </dependency>

Share

《程序员如何技术变现》

// TODO 这周主题早就想好了,但一直不知道如何写。

最近有点迷茫,感觉计算机这条路走着走着柳暗花明了,但要学习的东西越来越多。最近身边有很多不错的哥们建议我转行试试,也提供了就业机会。他们感觉没有那么多的“术”但已经得了“道”,但什么是道我也说不清,他们也没说清,可能就是一种对于成功懒得解释后的说辞吧。

Research

本周还是继续Flink方向,课余时间研究了一下抢鞋脚本工具。

相关文章

  • ARTS-第六周

    Algorithm 二叉树根据值删除节点 Review Flink自定义TableSource和TableSink...

  • ARTS-第七周

    Algorithm 一、用链表和二叉树实现Set集合 GitHub地址 二、散列表 散列表就是使用数组下标随机访问...

  • ARTS-第二周

    Algorithm 从基础开始手写动态数组 git代码地址 数组定义:数组(Array)是一种线性表数据结构。它用...

  • ARTS-第四周

    Algorithm 使用链表实现栈和队列 git代码地址 Review 继续阅读Flink官网 这次主要看Tabl...

  • ARTS-第八周

    Algorithm 用链表和二叉树实现Set集合 GitHub地址 Review 刚刚,各大互联网公司联手宣布,反...

  • ARTS-第三周

    Algorithm 这周实现了最基本的动态数据结构链表,并用数组和链表分别实现了栈和队列。 git代码地址 数组和...

  • ARTS-第一周

    追随耗子哥的脚步,每周ARTS。一篇Algorithm 是一道算法题,Review 是读一篇英文文章,Techni...

  • ARTS-第八周第九周

    家中有事,手边无电脑,所以两周并做一周 Algorithm 数据结构实现堆 用堆实现优先队列 github Rev...

  • 左耳听风-ARTS-第 1 周

    ARTS 是耗子叔发起的一个活动 A(Alogarithm):每周至少做一个 leetcode 算法题R(Revi...

  • 效能复盘践行六:检视系统之周检视、月检视

    212班10.0践行第六周作业安排(2020.6.5~6.11) 第六周主题:检视系统之周检视、月检视 作业:完成...

网友评论

      本文标题:ARTS-第六周

      本文链接:https://www.haomeiwen.com/subject/tajvmqtx.html