今天是mybatis的最后一天,也是最为重要的一天,mybatis与spring整合,(spring相关知识我会抽一个大的模块进行讲解).

首先加入Spring的依赖

<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<!-- Mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<!-- 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>0.9.1</version>
</dependency> <!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency> <!-- Mybatis 和 Spring整合包 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</dependency> <!-- 连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>

先创建applicationContext.xml

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd"> <!-- 使用spring自带的占位符替换功能 -->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<!-- 允许JVM参数覆盖 -->
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<!-- 忽略没有找到的资源文件 -->
<property name="ignoreResourceNotFound" value="true" />
<!-- 配置资源文件 -->
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
</list>
</property>
</bean>
<context:component-scan base-package="com.j1"/>
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
init-method="init" destroy-method="close">
<!-- 数据库驱动 -->
<property name="driverClassName" value="${jdbc.driver}" />
<!-- 基本属性 url、user、password -->
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" /> <!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="10" />
<property name="minIdle" value="5" />
<property name="maxActive" value="50" /> <!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000" /> <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000" /> <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="300000" /> <property name="validationQuery" value="SELECT 1" />
<property name="testWhileIdle" value="true" />
<property name="testOnBorrow" value="false" />
<property name="testOnReturn" value="false" /> <!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<!-- 如果用Oracle,则把poolPreparedStatements配置为true,mysql可以配置为false。分库分表较多的数据库,建议配置为false。 -->
<property name="poolPreparedStatements" value="false" />
<property name="maxPoolPreparedStatementPerConnectionSize"
value="20" /> <!-- 配置监控统计拦截的filters -->
<property name="filters" value="stat" />
</bean> <!-- 构造sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!-- 指定Mybatis的配置文件 -->
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
</bean>
<!-- 定义Mapper -->
<bean id="orderMapper" class="org.mybatis.spring.mapper.MapperFactoryBean">
<!-- 指定接口 -->
<property name="mapperInterface" value="com.j1.mybatis.mapper.OrderMapper" />
<!-- 指定sqlSessionFactory -->
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
</bean>
</beans>

通过Spring 来获得OrderMapper

private OrderMapper orderMapper;

    @Before
public void setUp() throws Exception {
try {
/**
* 这是之前的写法,现在我们来集成Spring做这件事情,就会很简单
* // 构造SqlSessionFactory
// 定义配置文件路径
String resource = "mybatis-config.xml";
// 读取配置文件
InputStream inputStream = Resources.getResourceAsStream(resource);
// 通过SqlSessionFactoryBuilder构建一个SqlSessionFactory
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder()
.build(inputStream);
// this.userDAO = new UserDao(sqlSessionFactory);
SqlSession sqlSession = sqlSessionFactory.openSession(true);
this.orderMapper = sqlSession.getMapper(OrderMapper.class);
*/
ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
this.orderMapper=context.getBean(OrderMapper.class);
} catch (Exception e) {
e.printStackTrace();
} }

进行测试:

/**
* 一对一的第二种查询
*/
@Test
public void testQuerOrderAndUserByOrderNum2() {
Order order = orderMapper.querOrderAndUserByOrderNum2("20140921002");
System.out.println(order);
}
 /**
* 根据订单号查询订单并且查询出下单人的信息,第二种实现
*
* @param orderNumber
* @return
*/
public Order querOrderAndUserByOrderNum2(String orderNum);
<!-- 一对一的第二种查询方法,进行映射 -->
<resultMap id="orderMap" type="Order" autoMapping="true">
<id column="id" property="id"/>
<association property="user" javaType="User" autoMapping="true"> </association>
</resultMap>
<select id="querOrderAndUserByOrderNum2" resultMap="orderMap">
SELECT
o.*,
u.name,
u.user_name,
u.age
FROM
tb_order o
LEFT JOIN tb_user u ON u.id = o.user_id
WHERE
o.order_number = #{orderNumber} </select>

这套代码运行下来,初级的Spring的整合就结束了.

接着我们来整理applicationContext.xml,使其更加简明扼要.

<!-- 定义Mybatis mapper接口扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.j1.mybatis.mapper" />
</bean>
 <!-- 构造sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!-- 指定Mybatis的配置文件 -->
<property name="configLocation" value="classpath:mybatis-config.xml"></property>
<!-- 使用通配符配置mapper.xml -->
<property name="mapperLocations" value="classpath:mappers/*.xml"></property>
</bean>

如果指定了mapper不需要定义接口扫描,如果xml与mapper的java代码分离的话就必须定义接口扫描器,否则或报错.

1.1. Mapper整合Service

package com.j1.mybatis.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import com.j1.mybatis.mapper.OrderMapper;
import com.j1.mybatis.pojo.Order; @Service
public class OrderService {
@Autowired
private OrderMapper orderMapper; public Order querOrderAndUserByOrderNum2(String orderNum){
return orderMapper.querOrderAndUserByOrderNum2(orderNum);
}
}
package com.j1.mybatis.mapper;

import static org.junit.Assert.*;

import java.io.IOException;
import java.io.InputStream; import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.aspectj.apache.bcel.util.ClassPath;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; import com.j1.mybatis.pojo.Order;
import com.j1.mybatis.pojo.OrderUser;
import com.j1.mybatis.pojo.User;
import com.j1.mybatis.service.OrderService; public class OrderMapperTest {
private OrderMapper orderMapper; private OrderService orderService;
@Before
public void setUp() throws Exception {
try { ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml"); this.orderService=context.getBean(OrderService.class);
} catch (Exception e) {
e.printStackTrace();
} } /**
* 一对一查询的第一种方法
*/
@Test
public void testQuerOrderAndUserByOrderNumY() {
OrderUser orderUser = this.orderMapper
.querOrderAndUserByOrderNumY("20140921002");
System.out.println(orderUser);
} /**
* 一对一的第二种查询
*/
@Test
public void testQuerOrderAndUserByOrderNum2() {
// Order order = orderMapper.querOrderAndUserByOrderNum2("20140921002");
Order order=orderService.querOrderAndUserByOrderNum2("20140921002");
System.out.println(order);
} /**
* 一对多的查询
*/
@Test
public void queryOrderAndUserAndOrderDetailByOrderNumber() {
Order order = orderMapper
.queryOrderAndUserAndOrderDetailByOrderNumber("20140921002");
System.out.println(order);
} /**
* 多对多的查询
*/
@Test
public void testQueryOrderAndUserAndOrderDetailAndItemByOrderNumber() {
Order order = this.orderMapper
.queryOrderAndUserAndOrderDetailAndItemByOrderNumber("20140921001");
System.out.println(order);
} }

1.   整合spring事务管理

为什么要整合Spring的事务管理呢?

先分析一下,其实这和mybatis没任何关系,只是事务管理用Spring来进行管理罢了.

创建applicationContext-transaction.xml文件,

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd"> <!-- 定义事务管理器 -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean> <!-- 定义事务策略 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!--所有以query开头的方法都是只读的 -->
<tx:method name="query*" read-only="true" />
<!--其他方法使用默认事务策略 -->
<tx:method name="*" />
</tx:attributes>
</tx:advice> <aop:config>
<!--pointcut元素定义一个切入点,execution中的第一个星号 用以匹配方法的返回类型,
这里星号表明匹配所有返回类型。 com.abc.dao.*.*(..)表明匹配com.j1.mybatis.service包下的所有类的所有
方法 -->
<aop:pointcut id="myPointcut" expression="execution(* com.j1.mybatis.*.*(..))" />
<!--将定义好的事务处理策略应用到上述的切入点 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="myPointcut" />
</aop:config> </beans>
package com.j1.mybatis.service;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; import com.j1.mybatis.pojo.Order; public class OrderServiceTest { private OrderService orderService; @Before
public void setUp() throws Exception {
ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"applicationContext.xml","applicationContext-transaction.xml"});
this.orderService = context.getBean(OrderService.class);
} @Test
public void querOrderAndUserByOrderNum2() {
Order order = this.orderService.querOrderAndUserByOrderNum2("20140921001");
System.out.println(order);
} }

log如下:

2016-09-21 21:56:08,886 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Creating instance of bean '(inner bean)#2369fbfa'
2016-09-21 21:56:08,886 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0'
2016-09-21 21:56:08,896 [main] [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource]-[DEBUG] Adding transactional method [query*] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly]
2016-09-21 21:56:08,896 [main] [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource]-[DEBUG] Adding transactional method [*] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]
2016-09-21 21:56:08,897 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0'
2016-09-21 21:56:08,897 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0'
2016-09-21 21:56:08,901 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Finished creating instance of bean '(inner bean)#2369fbfa'
2016-09-21 21:56:08,902 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Invoking afterPropertiesSet() on bean with name 'txAdvice'
2016-09-21 21:56:08,902 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Finished creating instance of bean 'txAdvice'
2016-09-21 21:56:08,902 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'org.springframework.aop.config.internalAutoProxyCreator'
2016-09-21 21:56:08,902 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0'
2016-09-21 21:56:08,902 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor'
2016-09-21 21:56:08,903 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor'
2016-09-21 21:56:08,903 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'orderMapper'
2016-09-21 21:56:08,903 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'userMapper'
2016-09-21 21:56:08,906 [main] [org.springframework.context.support.ClassPathXmlApplicationContext]-[DEBUG] Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@3fc12084]
2016-09-21 21:56:08,907 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'lifecycleProcessor'
2016-09-21 21:56:08,911 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'sqlSessionFactory'
2016-09-21 21:56:08,913 [main] [org.springframework.core.env.PropertySourcesPropertyResolver]-[DEBUG] Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
2016-09-21 21:56:08,914 [main] [org.springframework.core.env.PropertySourcesPropertyResolver]-[DEBUG] Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
2016-09-21 21:56:08,914 [main] [org.springframework.core.env.PropertySourcesPropertyResolver]-[DEBUG] Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
2016-09-21 21:56:08,915 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Returning cached instance of singleton bean 'orderService'
2016-09-21 21:56:08,932 [main] [org.mybatis.spring.SqlSessionUtils]-[DEBUG] Creating a new SqlSession
2016-09-21 21:56:08,956 [main] [org.mybatis.spring.SqlSessionUtils]-[DEBUG] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6848db81] was not registered for synchronization because synchronization is not active
2016-09-21 21:56:08,976 [main] [org.springframework.jdbc.datasource.DataSourceUtils]-[DEBUG] Fetching JDBC Connection from DataSource
2016-09-21 21:56:08,988 [main] [org.mybatis.spring.transaction.SpringManagedTransaction]-[DEBUG] JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@c59de6f] will not be managed by Spring
2016-09-21 21:56:09,001 [main] [com.j1.mybatis.mapper.OrderMapper.querOrderAndUserByOrderNum2]-[DEBUG] ==> Preparing: SELECT o.*, u.name, u.user_name, u.age FROM tb_order o LEFT JOIN tb_user u ON u.id = o.user_id WHERE o.order_number = ?
2016-09-21 21:56:09,107 [main] [com.j1.mybatis.mapper.OrderMapper.querOrderAndUserByOrderNum2]-[DEBUG] ==> Parameters: 20140921001(String)
2016-09-21 21:56:09,264 [main] [com.j1.mybatis.mapper.OrderMapper.querOrderAndUserByOrderNum2]-[DEBUG] <== Total: 1
2016-09-21 21:56:09,264 [main] [com.alibaba.druid.pool.PreparedStatementPool]-[DEBUG] {conn-10010, pstmt-20000} enter cache
2016-09-21 21:56:09,278 [main] [org.mybatis.spring.SqlSessionUtils]-[DEBUG] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6848db81]
2016-09-21 21:56:09,279 [main] [org.springframework.jdbc.datasource.DataSourceUtils]-[DEBUG] Returning JDBC Connection to DataSource
Order [id=1, userId=1, orderNumber=20140921001, user=User [id=1, userName=zhangsan, password=null, name=张三, age=30, sex=null, birthday=null, created=null, updated=null]]

好了,至此,mybatis已全部结束,有问题,大家在一起沟通,互相交流

mybatis与spring的整合的更多相关文章

  1. 【Java EE 学习 79 下】【动态SQL】【mybatis和spring的整合】

    一.动态SQL 什么是动态SQL,就是在不同的条件下,sql语句不相同的意思,曾经在“酒店会员管理系统”中写过大量的多条件查询,那是在SSH的环境中,所以只能在代码中进行判断,以下是其中一个多条件查询 ...

  2. 由“单独搭建Mybatis”到“Mybatis与Spring的整合/集成”

    在J2EE领域,Hibernate与Mybatis是大家常用的持久层框架,它们各有特点,在持久层框架中处于领导地位. 本文主要介绍Mybatis(对于较小型的系统,特别是报表较多的系统,个人偏向Myb ...

  3. SSM :MyBatis与Spring的整合

    MyBatis与Spring的整合 一:Spring整合MyBatis的准备工作: (1.)在项目中加入Spring,ByBatis及整合相关的jar文件 (2.)建立开发目录结构,创建实体类 (3. ...

  4. mybatis与spring的整合(代码实现)

    mybatis与spring的整合(代码实现) 需要jar包: mybatis核心包:依赖包:log4j包:spring croe;beans;tx;aop;aspects;context;expre ...

  5. Java基础-SSM之Spring和Mybatis以及Spring MVC整合案例

    Java基础-SSM之Spring和Mybatis以及Spring MVC整合案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 能看到这篇文章的小伙伴,详细你已经有一定的Java ...

  6. mybatis 学习笔记(四):mybatis 和 spring 的整合

    mybatis 学习笔记(四):mybatis 和 spring 的整合 尝试一下整合 mybatis 和 spring. 思路 spring通过单例方式管理SqlSessionFactory. sp ...

  7. MyBatis与Spring的整合实例详解

    从之前的代码中可以看出直接使用 MyBatis 框架的 SqlSession 访问数据库并不简便.MyBatis 框架的重点是 SQL 映射文件,为方便后续学习,本节讲解 MyBatis 与 Spri ...

  8. mybatis和spring的整合

    Mybatis与Spring的集成 1.配置Spring环境 创建maven工程 pom.xml导入依赖 <project xmlns="http://maven.apache.org ...

  9. Java框架搭建-Maven、Mybatis、Spring MVC整合搭建

    1. 下载eclipse 到网站下载 http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/marsr 选择 ...

随机推荐

  1. Ubuntu桌面版与服务器版有什么不同?

         提到安装Linux,Ubuntu可谓是最受欢迎的.为了满足每个人的需求,出现了不少版本或风格的Ubuntu;其中两项便是桌面版与服务器版.只要发布版本号一致,这两者从核心来说也就是相同的,唯 ...

  2. thinkphp 配置

    ThinkPHP框架中所有配置文件的定义格式均采用返回PHP数组的方式,格式为: //项目配置文件 return array( 'DEFAULT_MODULE' => 'Index', //默认 ...

  3. 2.2 文件 I/O 的基石:Path

    Path通常代表文件系统中的位置,能浏览任何类型的文件系统,包括zip归档文件系统: 文件系统中的几个概念:目录树.根目录.绝对路径.相对路径: NIO.2中的Path是一个抽象构造,你所创建和处理的 ...

  4. AJAX快速上手

    创建XMLHttpRequest对象 xmlHttp = new XMLHttpRequest(); xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); ...

  5. ASP.NET MVC下的异步Action的定义和执行原理

    一.基于线程池的请求处理ASP.NET通过线程池的机制处理并发的HTTP请求.一个Web应用内部维护着一个线程池,当探测到抵达的针对本应用的请求时,会从池中获取一个空闲的线程来处理该请求.当处理完毕, ...

  6. AE-模板替换->愉快今日--视频样片!

  7. Spark任务调度流程及调度策略分析

    Spark任务调度 TaskScheduler调度入口: (1)       CoarseGrainedSchedulerBackend 在启动时会创建DriverEndPoint. 而DriverE ...

  8. hdu 4535 吉哥系列故事——礼尚往来

    http://acm.hdu.edu.cn/showproblem.php?pid=4535 错排公式:a[i]=(i-1)*(a[i-2]+a[i-1]): #include <cstdio& ...

  9. C51系列RAM寄存器表

    特殊功能寄存器地址表 SFR 符号 字节 地址 位地址和位名称 D7 D6 D5 D4 D3 D2 D1 D0 P0口 P0 80H P0.7 P0.6 P0.5 P0.4 P0.3 P0.2 P0. ...

  10. 18个SaaS及其功能评价

    SAAS软件及其功能评价1. 360 两个同步功能都不错,却被埋没了2. 够快云3. DBFen4. Seafile5. 坚果云6. DZ7. 百度云8. 1159. 迷你云10. 微云11. Dro ...