NVWAL 非易失Write-Ahead Log设计(前提知识)
预写式日记
在使用WAL的系统中,所有的修改在提交之前都要先写入log文件中。
就好像我们写备忘录一样,我们要做什么就先写在备忘录里面.然后根据备忘录确定我们要做的事情是做了还是没做或者只做了一点. WAL就类似这个原理,然后就能保证原子性和持久性
维基百科的解释
https://zh.wikipedia.org/wiki/预写式日志
in-place算法
就地更新,不需要额外的空间辅助去更新...
MapReduce Hive 导入数据到 HBase
导读:
业务需求,需要将Hive中数据导入到HBase,笔者先用Java API 的方式开发了一版,但是在测试过后,效果不是很理想,如果数据量不大的情况下,可以使用,如果数据量成百上千万,甚至上亿,数据导入效率太低,时间太长,所以后面又使用MapReduce 重新编写了。废话不多说,小二上菜了。
1.项目构建
1.1 项目结构
项目使用Maven构建,项目结构如下
bigdata-data-syn...
【CodeForces】Mail.Ru Cup 2018 Round 1 (Div. 1 + Div. 2) 题解
【比赛链接】
点击打开连接
【题解链接】
点击打开链接
**【A】**Elevator or Stairs?
【思路要点】
按照题意计算两种方式的用时,取较优的方案采纳。
时间复杂度 O(1)O(1)O(1) 。
【代码】
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5...
大数据与信息安全(六)天网系统与大数据 大数据
大数据与信息安全(六)
大数据是什么?大数据是一个极为强大的信息数据的采集和收录系统,可以将我们日常工作生活中的所有数据,近乎可以全盘收录。大数据系统的设立,就是为了方便统计,不需要过去繁琐的操作,通过什么个体采样、分批采样等统计模式来获取信息数据,而是将所能采集到的数据,都通过大数据系统近乎完全彻底的收录进来,然后通过云计算来进行数据的分析处理,最后得出相应结论。大数据和云计算得出的结论...
数据归一化 特征处理
import numpy as np
X = np.zeros([1000,2])
x1=np.random.normal(0.0,3,[1000])
x2=np.random.normal(1.0,0.1,[1000])
#减去均值
x1 = x1-np.mean(x1)
x2 = x2 - np.mean(x2)
x1 = x1/(np.std(x1)+1e-6)
x2 = x2/(np.st...
Netty3 - 多连接的客户端示例
Netty 4/5 说明: 目前 http://netty.io/ 发布的最新版本号4.1.30.Final,但是并没有netty5相关的版本发布了
Netty3 模拟多连接的客户端
package xss.netty.netty3.client;
import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss....
git 重置用户名 密码信息
git clone 时 ,权限不够。
如 fatal: unable to access : The requested URL returned error: 403
可能原因是,你之前在本电脑使用过git.
但是以前和现在又不是同一个账户。所以当你现在使用 git clone url 时 ,默认使用以前的账户信息。所以出现没有权限的状况。
解决方法:
重置本机保留的git config 信息。...
POJ-3189 Steady Cow Assignment
网络流+二分+枚举区间
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
using namespace std;
typedef long long ll;
c...
c3p0-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
<default-config>
<property name="jdbcUrl">jdbc:mysql://localhost:3306/jdbc?characterEncoding=UTF8</pr
二叉树基础操作 ,前中后序遍历,求二叉树高度,二叉搜索树(二叉排序树)Java实现 代码集合
首先,定义一个树对象Tree.java
public class Tree {
public TreeNode root;
}
定义树节点对象TreeNode.java
public class TreeNode {
public TreeNode(int data) {
this.data = data;
}
public int data;
public TreeNode ...
ES6的module.export与export default对比CommonJS的module.exports与exports
两个差异
CommonJS 模块输出的是一个值的拷贝,ES6 模块输出的是值的引用。
什么是值的拷贝,值的引用?
所谓值的拷贝,是在栈内存当中实现的,是一个复制的过程,复制之后两个值互不影响
值的引用,是在堆内存当中实现的,当一个引用类型赋值给一个变量时,此时变量拥有指向引用类型的一个指针,当变量发生改变,被引用的值也会发生改变
CommonJS 模块是运行时加载,ES6 模块是编译时输...
云服务器搭建node环境
购买云服务器
1. 安全组(自定义安全规则,开放相应端口号供外部访问)
购买域名(可有可无)
1. 域名审核
2. 备案(流程较长)
3. 修改DNS(将不同厂商购买的域名解析域名到云服务器)
4. 解析域名
软件安装
1. 安装git
2. 安装nvm(node版本管理工具),通过nvm安装node
3. 安装mysql
...
【LeetCode】81. Binary Tree Maximum Path Sum
题目描述(Hard)
Given a non-empty binary tree, find the maximum path sum.
For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-chi...
【LeetCode】82. Populating Next Right Pointers in Each Node
题目描述(Medium)
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node. If there is...
【LeetCode】83. Sum Root to Leaf Numbers
题目描述(Medium)
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
...
【LeetCode】84. Merge Sorted Array
题目描述(Easy)
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.
Note:
The number of elements initialized in nums1 and nums2 are m and n respectively.
You ma...
【LeetCode】85. Merge Two Sorted Lists
题目描述(Easy)
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.
题目链接
https://leetcode.com/problems/merge-two...
【LeetCode】86. Merge k Sorted Lists
题目描述(Hard)
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
题目链接
https://leetcode.com/problems/merge-k-sorted-lists/description/
Example 1:
Inpu...
今日推荐
周排行