首页 文章 精选 留言 我的

精选列表

搜索[Table组件],共10000篇文章
优秀的个人博客,低调大师

hadoop核心组件zookeeper简介与特点

zookeeper是一个针对大型分布式系统的可靠协调系统。 1)它提供的功能包括:配置维护,名字服务,分布式同步,组服务等; 2)它的目标就是封装好复杂易出错的关键服务,将简单易用的接口和性能高效,功能稳定的系统提供给用户; 特点: 1,最终一致性:为客户端展示同一试图 2,可靠性:如果一条消息被一台服务器接受,那么它将被所有的服务器接受。 3,实时性:zookeeper不能保证两个客户端同时得到刚刚更新的数据,如果需要最新数据,应该在读数据之前调用sync()接口。 4,等待无关(wait-free):慢的或者失效的client不干预快速的client的请求。 5,原子性:更新操作要么成功,要么失败,没有中间状态。 6,顺序性:对于所有server,同一消息发布顺序一致。 基本原理 server很多,有主从之分,不过有一个leader,其他是follower, 每个server,在内存中存有一份数据,启动时,将选举出一个leader,根据poxos协议选举 leader负责处理数据更新操作,用到zab协议 一个更新操作成功的标志,大多数server在内存,成功修改数据(一个有5个,有3个写成功了) 本文转自 skinglzw 51CTO博客,原文链接:http://blog.51cto.com/skinglzw/1833186,如需转载请自行联系原作者

优秀的个人博客,低调大师

android组件通讯 Intent-Action属性

Action属性应用实例 1、自定义Action属性 程序文件 /Chapter06_Intent_TestAction/src/com/amaker/ch06/app/MainActivity.java 代码 packagecom.amaker.ch06.app; importandroid.app.Activity; importandroid.content.Intent; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; /** * *测试IntentAction属性 */ publicclassMainActivityextendsActivity{ //定义Action属性常量 publicstaticfinalStringMY_ACTION="com.amaker.ch07.app.MY_ACTION"; //声明Button privateButtonbtn; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); //设置布局视图 setContentView(R.layout.main); //实例化Button btn=(Button)findViewById(R.id.Button01); btn.setOnClickListener(newOnClickListener(){ @Override publicvoidonClick(Viewv){ //实例化Intent Intentintent=newIntent(); //为Intent设置Action属性 intent.setAction(MY_ACTION); //启动Activity startActivity(intent); } }); } } /Chapter06_Intent_TestAction/src/com/amaker/ch06/app/MyActivity.java 代码 packagecom.amaker.ch06.app; importandroid.app.Activity; importandroid.content.Intent; importandroid.os.Bundle; importandroid.widget.TextView; /** *测试IntentAction属性 */ publicclassMyActivityextendsActivity{ //声明TextView privateTextViewtv; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); //设置视图布局 setContentView(R.layout.my_layout); //获得Intent对象 Intentintent=getIntent(); //获得Action Stringaction=intent.getAction(); //获得TextView tv=(TextView)findViewById(R.id.TextView01); //设置内容 tv.setText(action); } } 布局文件 /Chapter06_Intent_TestAction/res/layout/main.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:text="测试Intent的Action属性" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> </LinearLayout> /Chapter06_Intent_TestAction/res/layout/my_layout.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:text="@+id/TextView01" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </LinearLayout> 清单文件 /Chapter06_Intent_TestAction/AndroidManifest.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <manifestxmlns:android="http://schemas.android.com/apk/res/android" package="com.amaker.ch06.app" android:versionCode="1" android:versionName="1.0"> <applicationandroid:icon="@drawable/icon"android:label="@string/app_name"> <activityandroid:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <actionandroid:name="android.intent.action.MAIN"/> <categoryandroid:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activityandroid:name="MyActivity"> <intent-filter> <actionandroid:name="com.amaker.ch06.app.MY_ACTION"/> <categoryandroid:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> </application> <uses-sdkandroid:minSdkVersion="3"/> </manifest> 2、访问系统的Action属性 程序文件 /Chapter06_Intent_TestAction2/src/com/amaker/ch06/app/MainActivity.java 代码 packagecom.amaker.ch06.app; importandroid.app.Activity; importandroid.content.Intent; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; /** * *测试IntentAction属性 */ publicclassMainActivityextendsActivity{ //声明Button privateButtonbtn; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); //设置当前布局视图 setContentView(R.layout.main); //实例化Button btn=(Button)findViewById(R.id.Button01); btn.setOnClickListener(newOnClickListener(){ @Override publicvoidonClick(Viewv){ //创建Intent Intentintent=newIntent(); //设置IntentAction属性 intent.setAction(Intent.ACTION_GET_CONTENT); //设置IntentType属性 intent.setType("vnd.android.cursor.item/phone"); //启动Activity startActivity(intent); } }); } } 布局文件 /Chapter06_Intent_TestAction2/res/layout/main.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:text="测试Intent的Action属性" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> </LinearLayout> 清单文件 /Chapter06_Intent_TestAction2/AndroidManifest.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <manifestxmlns:android="http://schemas.android.com/apk/res/android" package="com.amaker.ch06.app" android:versionCode="1" android:versionName="1.0"> <applicationandroid:icon="@drawable/icon"android:label="@string/app_name"> <activityandroid:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <actionandroid:name="android.intent.action.MAIN"/> <categoryandroid:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> <uses-sdkandroid:minSdkVersion="3"/> </manifest> 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080670

优秀的个人博客,低调大师

android组件通讯 Intent-Category属性

程序文件 /Chapter06_Intent_Category/src/com/amaker/test/MainActivity.java 代码 packagecom.amaker.test; importandroid.app.Activity; importandroid.content.Intent; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; /** *测试Intent的Category属性 */ publicclassMainActivityextendsActivity{ //声明Button privateButtonb1; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); //设置当前布局 setContentView(R.layout.main); //实例化Button b1=(Button)findViewById(R.id.Button01); //为Button添加监听器 b1.setOnClickListener(newOnClickListener(){ @Override publicvoidonClick(Viewv){ //实例化Intent Intenti=newIntent(); //添加Action属性 i.setAction(Intent.ACTION_MAIN); //添加Category属性 i.addCategory(Intent.CATEGORY_HOME); //启动Activity startActivity(i); } }); } } 布局文件 /Chapter06_Intent_Category/res/layout/main.xml 代码 <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="IntentCategory测试"/> <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="回到Home"></Button> </LinearLayout> 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080666

资源下载

更多资源
Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册