Kafka在zookeeper里面的存储结构详解

当kafka启动的时候,就会向zookeeper里面注册一些信息,这些数据也称为Kafka的元数据信息。 一、zookeeper存储结构总图 1.根目录下的结构 [zk: localhost:2181(CONNECTED) 72] ls / [isr_change_notification, zookeeper, admin, consumers, cluster, config, latest_producer_id_block, controller, brokers, controll
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

kafka 入门实例(eclipse+java)

1. 先导入相关的Jar包 2.生产者端的代码 package demo1; import java.util.Properties; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.serialization.StringSerializer;
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

mycat安装及入门(windows下安装)

https://github.com/MyCATApache/Mycat-download 具体下载哪个版本以发布为准 一、安装及启动: 1.安装 切换到mycat 目录 mycat.bat install 2.启动 mycat.bat start 3.查询运行状态 mycat.bat status 4.停止服务 mycat.bat stop 二、配置文件介绍 2.1 Mycat主要的配置文件: --server.xml:是Mycat服务器参数调整和用户授权的配置文件。
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

分布式时务常见的几种解决方案

原文地址:https://www.cnblogs.com/savorboard/p/distributed-system-transaction-consistency.html 数据库事务 在说分布式事务之前,我们先从数据库事务说起。 数据库事务可能大家都很熟悉,在开发过程中也会经常使用到。但是即使如此,可能对于一些细节问题,很多人仍然不清楚。比如很多人都知道数据库事务的几个特性:原子性(Atomicity )、一致性( Consistency )、隔离性或独立性( Isolation)和持
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

关系数据库中in和exists的区别(看后不懂找我麻烦)

源文章:http://www.cnblogs.com/liyasong/ 表展示     首先,查询中涉及到的两个表,一个user和一个order表,具体表的内容如下:     user表:          order表:        in     确定给定的值是否与子查询或列表中的值相匹配。in在查询的时候,首先查询子查询的表,然后将内表和外表做一个笛卡尔积,然后按照条件进行筛选。所以相对内表比较小的时候,in的速度较快。     具体sql语句如下: 1 SELECT 2
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

MapReduce shuffle过程详解(二)

原文:https://blog.csdn.net/u014374284/article/details/49205885 一、MapReduce计算模型 我们知道MapReduce计算模型主要由三个阶段构成:Map、shuffle、Reduce。 Map是映射,负责数据的过滤分法,将原始数据转化为键值对;Reduce是合并,将具有相同key值的value进行处理后再输出新的键值对作为最终结果。为了让Reduce可以并行处理Map的结果,必须对Map的输出进行一定的排序与分割,然后再交给对应的R
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Http POST请求数据提交格式

做开发时,会用到post提交数据,原来是用httpmime包来处理数据封装, 但为了一个小需求,引入一个几十kb的jar,总感觉不值,学习一下post请求的格式,自己顺便练下手,实现一个 服务端通常是根据请求头(headers)中的 Content-Type 字段来获知请求中的消息主体是用何种方式编码,再对主体进行解析。所以说到 POST 提交数据方案,包含了 Content-Type 和消息主体编码方式两部分。 application/x-www-form-urlencoded 最基本的fo
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

The module `./login/Login` could not be found from `/Library/AndroidDevelop/RNDev/byle/index.js`. In

The module `./login/Login` could not be found from `/Library/AndroidDevelop/RNDev/byle/index.js`. Indeed, none of these files exist: * `/Library/AndroidDevelop/RNDev/byle/login/Login(.native||.android.js|.native.js|.js|.android.json|.native.json|.js
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

HashMap原理,Hash冲突,同步集合和并发集合及实现原理

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/donghejk/article/details/83781932 HashMap的原理 通过hash的方法,通过put和get存储和获取对象。 存储对象时:我们将K/V传给put方法时,它调用hashCode计算hash从而得到bucket位置,进一步存储,HashMap会根据当前bucket的占用情况自动调整容量(超过LoadFacotr则resize为原来的2倍)。 获取对象时:我们将K传给
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Java线程同步(一)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/donghejk/article/details/83862362 为什么要考虑线程同步,当几个线程共享一份资源时会出现线程冲突。例如生产情景下,生产的物质正在放入共享区域时此时又一个线程要读取共享区域物质的个数此时就会出现冲突。线程同步实质是给线程进行排队。 看下面一个例子 Callme的同一实例传给每个Caller实例。 // This program is not synchronized
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Android应用启动说起

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/donghejk/article/details/84000430 一、前言: 读了很一些Androi源码,始终无法把这些知识串起来。今天准起航了,从应用启动开始,一点一点看下去,可能会经历一个漫长的时间,但无论如何都要坚持。 二、都会涉及哪些知识点 目前来说一定会涉及以下知识点: Launcher Binder、AIDL View绘制流程 推荐几个看源码的方式: Launcher是个app,手机
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

android UI适配

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/donghejk/article/details/88807522 本次项目中用了autosize头条适配方案。这次顺带把UI适配原理总结一下。 1.首先要明白一个公式: 公式:dp值×(当前dpi/160dpi)=>得出当前的像素数目 px :平常所说的1920×1080只是像素数量,也就是1920px×1080px,代表手机高度上有1920个像素点,宽度上有1080个像素点。 dpi:要想判别
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

SharedPreference了解

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/donghejk/article/details/88919994 今天调试代码发现大量的sp操作耗用了近3秒时间,当然里面交叉了gson操作。所以下面我查看了有关SharedPreference的文章 https://www.jianshu.com/p/63ee8587de3f 这是一篇非常有深度的文章。 引用这篇博客上面的代码 SharedPreferencesImpl(File f
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

React Naitve原理

一.React Native 框架分析 RN_整体框架图.png 层次架构: Java层:该层主要提供了Android的UI渲染器UIManager(将JavaScript映射成Android Widget)以及一些其他的功能组件(例如:Fresco、Okhttp)等,在java层均封装为Module,java层核心jar包是react-native.jar,封装了众多上层的interface,如Module,Registry,bridge等。 C++层:主要处理Java与JavaScript
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Leetcode-4 Median of Two Sorted Arrays (java)

Median of Two Sorted Arrays 题目 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: nums1 = [1, 3] nums2 = [2] The med
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Leetcode-9 Palindrome Number (java)

9. Palindrome Number 原题目 Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to string, note the restriction of using e
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Leetcode-13 Roman to Integer (java)

13. Roman to Integer 原题目 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 题目翻译 将给定的一个罗马数字字符串转换为整数 假定的输入范围是1到3999. 解决思路 这道里面本身很简单,其实难点在于必须要明白罗马数字的标识方法。 罗马数字一共有七个大写字符,分别是:I、V、X、L、C、D、M。 下面是罗马字
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Leetcode-19 Remove Nth Node From End of List

19. Remove Nth Node From End of List 原题目 Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list become
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Leetcode-21 Merge Two Sorted Lists (java)

21. Merge Two Sorted Lists 原题目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 翻译 将两个有序链表合并成一个新的链表。新的链表应该有由这两个链表的头部拼接而成。 解题思路 按照题意新链表有这两个有序链表的头部拼接而成,所以需要先找
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0

Leetcode-23 Swap Nodes in Pairs (java)

24. Swap Nodes in Pairs 原题目 Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. You may not modify the values
分类: 其他 发布时间: 05-11 21:41 阅读次数: 0