- 博客(48)
- 收藏
- 关注
转载 spring cloud consul
Consul是HashiCorp公司推出的开源软件,使用GO语言编写,提供了分布式系统的服务注册和发现、配置等功能,这些功能中的每一个都可以根据需要单独使用,也可以一起使用以构建全方位的服务网格。Consul不仅具有服务治理的功能,而且使用分布式一致协议RAFT算法实现,有多数据中心的高可用方案,并且很容易和Spring Cloud等微服务框架集成,使用起来非常的简单,具有简单、易用、可插排等特点。使用简而言之,Consul提供了一种完整的服务网格解决方案。
2023-05-08 23:02:10
175
转载 微服务框架Finagle介绍 Part2: 在Finagle中开发基于Http协议的应用
原文地址:http://skaka.me/blog/2016/05/01/finagle2/在上篇文章中我介绍了Finagle中的Future/Service/Filter. 这篇文章里, 我们将构建一个基于Http协议的echo服务端和客户端, 下篇文章将构建一个基于thrift协议的客户端和服务端. 这两篇文章对应的源代码地址在Github. 代码中有Java和Scala版
2017-05-18 11:20:37
538
转载 微服务框架Finagle介绍 Part1: Future, Service, Filter
原文地址:http://skaka.me/blog/2016/03/19/finagle1/微服务架构可能是时下最热的一种架构模式了. 这篇系列里, 我想介绍一些常用的微服务框架. 通过学习这些框架, 我们将会了解实现微服务的过程中会遇到哪些问题, 以及这些微服务框架是如何帮助我们解决这些问题的. 所以这是一篇关于微服务实践的系列, 我不会讨论太多概念性的东西. 系列末尾我会给出一些微
2017-05-18 11:18:51
629
转载 【Java】知乎:学习 JAVA,有什么书籍推荐?学习的方法和过程是怎样的?
①有一点C语言基础(初级的知道指针、数组链表、局部变量、全局变量、动态内存分配,堆栈)②知道C++主要是面向对象,类,封装,继承,多态什么的,但很初级的了解③现在想好好学JAVA,从什么书看起?(比如书1->书2),该如何学习?④需要理解 计算机系统 的知识吗?有什么好的书推荐?⑤希望对这方面了解比较深的人给予我关键的指导,看什么书籍、学习的方法,最好有一定的分析说明,真诚的感谢
2017-05-13 09:42:38
1749
原创 [LeetCode]125. Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a
2017-03-07 11:08:57
371
原创 [LeetCode]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,
2017-03-07 10:53:25
300
原创 [LeetCode]7 Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before c
2017-03-06 18:13:08
307
原创 [LeetCode]3 Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "
2017-03-06 17:57:06
311
原创 [LeetCode]344 Reverse String
Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".[JAVA] Simple and Clean with Explanations [6 Solutions]
2017-03-06 16:03:50
266
原创 [LeetCode]2 Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i
2017-03-06 15:32:51
298
原创 [LeetCode]520 Detect Capital
Given a word, you need to judge whether the usage of capitals in it is right or not.We define the usage of capitals in a word to be right when one of the following cases holds:All letters in t
2017-03-05 12:03:22
350
原创 [LeetCode]122 Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on
2017-03-05 11:29:12
218
原创 [LeetCode]121 Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),
2017-03-03 18:08:57
230
原创 [LeetCode]119 Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?My 8 lines
2017-03-03 17:16:25
232
原创 [LeetCode]118 Pascal's Triangle
Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]Solution in Java
2017-03-03 11:11:24
235
转载 如何在linux下开启FTP服务
如何在linux下开启FTP服务1. 首先服务器要安装ftp软件,查看是否已经安装ftp软件下: #which vsftpd 如果看到有vsftpd的目录说明服务器已经安装了ftp软件2. 查看ftp 服务器状态 #service vsftpd status3. 启动ftp服务器 #service vsftpd start4.
2017-02-24 10:45:29
410
原创 [LeetCode]88 Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addit
2017-02-14 17:35:31
272
原创 [LeetCode]66 Plus One
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.The digi
2017-02-14 16:16:13
235
原创 [LeetCode]53 Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] ha
2017-02-14 10:23:41
229
原创 [LeetCode]35 Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.
2017-02-13 10:52:12
278
原创 [LeetCode]27 Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.
2017-02-13 10:08:10
269
原创 [LeetCode]26 Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with
2017-02-09 11:30:06
199
原创 [LeetCode]268 Missing Number
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm shoul
2017-02-09 10:23:01
250
原创 [LeetCode]167 Two Sum II - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two number
2017-02-08 11:43:34
197
原创 [LeetCode]1 Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the sam
2017-02-08 11:16:27
221
原创 [LeetCode]169 Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority elem
2017-02-08 10:17:26
195
原创 [LeetCode]189 Rotate Array
Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note:Try to come up as many solutions as yo
2017-02-07 15:03:49
325
原创 [LeetCode]219 Contains Duplicate II
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is a
2017-01-24 10:41:42
212
原创 [LeetCode]217 Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element
2017-01-19 09:57:54
216
原创 [LeetCode]283 Move Zeroes
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling
2017-01-18 09:53:11
222
原创 [LeetCode]414 Third Maximum Number
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1:Input: [3, 2,
2017-01-16 18:19:34
469
原创 [LeetCode]442 Find All Duplicates in an Array
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it without ex
2017-01-16 16:20:12
202
原创 [LeetCode]448 Find All Numbers Disappeared in an Array
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in this array.
2017-01-16 15:41:49
367
原创 [LeetCode]485 Max Consecutive Ones
Given a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are consecutiv
2017-01-16 11:14:57
202
转载 50天全民听力输入训练:Green Apple
想学好英语听力输入的重要性不言而喻,大部分人英语学不好的主要原因也在于此:词汇量不足,语法不会,听力输入几乎没有,就整天着急说,说越多错越多,越说越烂。所有人都忽略了一个重要事实,哪怕是在母语环境里,我们的婴儿也是到了两三岁才开始流利说汉语的,换言之,在开口说之前,我们至少听力输入了两年时间。外语学习的听力输入的时间有没有基本要求呢?目前科学上无法给出准确数据,我个人也无法证明,凭什么说我听力
2016-12-11 13:58:10
2362
转载 百日英语行动——ABC英文三阶段
这次我们来做一个百日学习计划,能完成多少看你自己。主要还是以听力输入为主。当然你非要问为什么要练听力,我就想练口语,怎么提高阅读写作词汇量之类的问题,我就当没看见,也懒得回答。反正免费,信我就学,不信就不看,这么简单事,你情我愿,何必纠缠来自讨没趣。这次就不分什么初级中级高级了,因为每次这么划分等级,总是有二百五过来问什么是初级中级以及高级,还有如何确认自己等级。所以这次我只分A/
2016-12-11 13:55:49
1024
转载 动态资源分配(Dynamic Resource Allocation)
转自:http://zhangxiong0301.iteye.com/blog/2192641从spark1.2开始,可以根据application的负载动态地增加和减少分配给application的资源。也就是说,你的application在不需要资源的时候会把资源退还给集群,而在需要的时候重新申请获得资源。这在spark集群上有多个application时候很有用。当分配给某个applicati
2016-06-30 18:14:28
5408
转载 combineByKey
/** * Generic function to combine the elements for each key using a custom set of aggregation * functions. This method is here for backward compatibility. It does not provide combiner * classt
2016-06-30 11:13:06
480
原创 15. Spark Streaming源码解读之No Receivers彻底思考
一、官方文档翻译Streaming从Kafka中接收数据,有两种方式:1). 使用Receivers和Kafka高层次的API;2). 基于Direct API(Spark 1.3开始引入的。这两种方式有不同的编程模型,性能特点和语义担保。1. 基于Receiver方式: 这种方法通过Receiver来接收数据。Receiver是通过使用kafka的high-level Consumer API
2016-05-27 16:43:55
489
原创 基于案例贯通Spark Streaming流计算框架的运行源码
案例代码:package com.dt.spark.sparkstreamingimport org.apache.spark.SparkConfimport org.apache.spark.sql.Rowimport org.apache.spark.sql.hive.HiveContextimport org.apache.spark.sql.types.{IntegerType, S
2016-05-23 18:03:06
390
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人