Mryqu's Notes


  • 首页

  • 搜索
close

[HBase] 使用ImportTsv命令导入数据

时间: 2015-03-16   |   分类: BigData     |   阅读: 105 字 ~1分钟
ImportTsv简介 ImportTsv是一款用于将TSV格式数据导入HBase的工具。它有两种用法: 通过Put将TSV格式数据导入HBase 通过批量导入数据的方式生成用于加载进HBase的存储文件 下面看一下ImportTsv的使用说明: ImportTsv参数 -Dimporttsv.skip.bad.lines=false - 若遇到无效行则失败 ‘-Dimporttsv.separator=|’ - 使用特定分隔符| -Dimporttsv.timestamp=currentTimeAsLong - 使用导入时的时间戳 -Dimporttsv.mapper.class=my.Mapper -使用用户自定义Mapper类替换TsvImporterMapper -Dmapreduce.job.name=jobName - 对导入使用特定mapreduce作业名 -Dcreate.table=no - 避免创建表,注:如设为为no,目标表必须存在于HBase中 -Dno.strict=true - 忽略HBase表列族检查。默认为false ImportTsv测试 准备数据 hadoop@node50064:~$ hadoop fs -cat /user/hadoop/tsv_input/sales2013.csv Name,Sex,Age,Height,Weight Alfred,M,14,69,112.5 Alice,F,13,56.5,84 Barbara,F,13,65.3,98 Carol,F,14,62.8,102.5 Henry,M,14,63.5,102.5 James,M,12,57.3,83 Jane,F,12,59.8,84.5 Janet,F,15,62.5,112.5 Jeffrey,M,13,62.5,84 John,M,12,59,99.5 Joyce,F,11,51.3,50.5 Judy,F,14,64.3,90 Louise,F,12,56.3,77 Mary,F,15,66.5,112 Philip,M,16,72,150 Robert,M,12,64.8,128 Ronald,M,15,67,133 Thomas,M,11,57.5,85 William,M,15,66.5,112 准备目标表 hbase(main):001:0> create 'sales2013', 'info' 0 row(s) in 4.5730 seconds => Hbase::Table - sales2013 hbase(main):002:0> create 'sales2013bulk', 'info' 0 row(s) in 2.
阅读全文 »

[OpenUI5] sap.ui.core.format.DateFormat使用

时间: 2015-03-15   |   分类: FrontEnd     |   阅读: 17 字 ~1分钟
使用javascript的Date类型,想要输出国际化的字符串,可以使用toLocaleString函数,但是需要自己往里设locale,并且输出结果随操作系统和浏览器不同而变化。 最后还是用OpenUI5的DateFormat,既可以固定格式有可以自动国际化。 var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({ pattern: "EEEE, MMMM d, yyyy HH:mm:ss a z" }); oDateFormat.format(new Date());

[OpenUI5] 将布尔型数据在数据表中显示为checkbox

时间: 2015-03-14   |   分类: FrontEnd     |   阅读: 20 字 ~1分钟
看了一下OpenUI5、Datatables和Vaadin中将布尔型数据在数据表中显示为checkbox的示例: OpenUI5 example: DataTable Datatables example: Always shown checkbox Vaadin table: How to display Boolean as checkboxes with editable=false 感觉还是OpenUI5更灵活,不过小项目用OpenUI5又太重了!

Retrieve the status of an process instance in Activiti

时间: 2015-03-13   |   分类: workflow     |   阅读: 219 字 ~2分钟
Retrieve the status of an running process instance Use the executionQuery() or processInstanceQuery() to find out ifany result is returned or not when querying execution/process byId. runtimeService.createProcessInstanceQuery().processInstanceId(specifiedProcessInstanceId).singleResult() runtimeService.createExecutionQuery().executionId(specifiedExecutionId).singleResult() Specially when the history capabilities of Activiti engine isenabled: Specified process/execution instance id: ProcessInstance inst = historyService.createHistoricProcessInstanceQuery().processInstanceId(specifiedProcessInstanceId).singleResult(); inst.isEnd() Unspecified process/execution instance id: historyService.createHistoricProcessInstanceQuery().finished().list() historyService.createHistoricProcessInstanceQuery().unfinished().list() Retrieve the active node of an running process instance RuntimeService provide the API to retrieve the active node of anrunning process instance:
阅读全文 »

粗览Activiti Explorer源代码

时间: 2015-03-12   |   分类: workflow     |   阅读: 37 字 ~1分钟
ActivitiExplorer的应用程序为org.activiti.explorer.ExplorerApp,其界面配置文件为Activiti\modules\activiti-webapp-explorer2\src\main\resources\activiti-ui-context.xml。通过该配置文件创建主窗口org.activiti.explorer.ui.MainWindow类实例,并通过org.activiti.explorer.ViewManagerFactoryBean创建实现org.activiti.explorer.ViewManager接口的org.activiti.explorer.DefaultViewManager或org.activiti.explorer.ui.alfresco.AlfrescoViewManager类实例。 在Activiti演示中采用的是org.activiti.explorer.DefaultViewManager类实例,它对主窗口进行视图管理,完成视图切换、对应导航栏和功能菜单的设置。 主窗口org.activiti.explorer.ui.MainWindow类实例通过org.activiti.explorer.ui.mainlayout.MainLayout类进行界面布局。 下面列举了Activiti Explorer两级导航栏所对应的页面实现类。 Tasks Inboxorg.activiti.explorer.ui.task.InboxPage My Tasksorg.activiti.explorer.ui.task.TasksPage Queuedorg.activiti.explorer.ui.task.QueuedPage Involvedorg.activiti.explorer.ui.task.InvolvedPage Archivedorg.activiti.explorer.ui.task.ArchivedPage Processes My Instancesorg.activiti.explorer.ui.process.MyProcessInstancesPage Deployed process definitionsorg.activiti.explorer.ui.process.ProcessDefinitionPage Model workspaceorg.activiti.editor.ui.EditorProcessDefinitionPage Reports Generate reportsorg.activiti.explorer.ui.reports.RunReportsPage Saved reportsorg.activiti.explorer.ui.reports.SavedReportsPage Manage Databaseorg.activiti.explorer.ui.management.db.DatabasePage Deploymentsorg.activiti.explorer.ui.management.deployment.DeploymentPage Active Processesorg.activiti.explorer.ui.management.processdefinition.ActiveProcessDefinitionPage Suspend Processesorg.activiti.explorer.ui.management.processdefinition.SuspendedProcessDefinitionPage Jobsorg.activiti.explorer.ui.management.job.JobPage Usersorg.activiti.explorer.ui.management.identity.UserPage Groupsorg.activiti.explorer.ui.management.identity.GroupPage Administrationorg.activiti.explorer.ui.management.admin.AdministrationPage Crystalballorg.activiti.explorer.ui.management.crystalball.CrystalBallPage

GoJS BPMN元素界面实现分析

时间: 2015-03-11   |   分类: workflow     |   阅读: 11 字 ~1分钟
GoJS BPMN里面的BPMN元素采用过不是PNG/JPEG这样的静态图标,而是通过GoJS在Cavas绘出来的。 由BPMN.js可知,一个BPMN元素是一个go.Node,内部大致包含go.Panel、go.Shape、go.TextBlock等对象,用于绘制外层的正方形、填充内部颜色、添加图标和文字。 如果创建自己定制的BPMN元素,最麻烦的就是图标了。现在我来看一下GoJS BPMN扩展里面的图标是怎么保存和绘制的。 GoJS BPMN扩展里面大部分的图标都已经在go.js里面以源代码的形式定义了,只有四个是在BPMN.js里面通过go.Shape.defineFigureGenerator方法定制的,分别是Empty、Annotation、BpmnTaskManual和BpmnTaskService。这四个图标的内容是GoJS geometry的格式保存的。 所有这些图标可以通过与go.Shape的figure进行绑定,由GoJS驱动完成底层绘制。我自己做了一个简单样例,对这些内嵌图标和BPMN定制图标稍微玩了点花样 http://jsfiddle.net/mryqu/mywy0nhz/ 显示效果如下:

了解Apache Accumulo

时间: 2015-03-10   |   分类: db+nosql     |   阅读: 31 字 ~1分钟
Apache Accumulo是一个可靠的、可伸缩的、高性能的排序分布式的Key-Value存储解决方案,提供了基于单元的访问控制以及可在数据处理过程中多个控制点修改键值对的服务器端编程机制。使用GoogleBigTable设计思路,基于ApacheHadoop、Zookeeper和Thrift构建。 Accumulo由美国国家安全局(NSA)于2008年开始研发,2011年捐赠给Apache基金会。Accumulo现已成为Apache基金会的顶级项目,并被评过第三大最受欢迎的NoSQL数据库引擎。 目前,Accumulo技术已经得到美国政府层面的全面认可,NSA已将该技术作为内部组织架构运行的核心部分,在对来源于各方面的庞大海量数据进行分析处理时,所应用的运算程序基本都运行在Accumulo技术上,即NSA“大多数监控和分析应用程序的后台都是Accumulo技术”。基于Hadoop的Accumulo技术已在实质上被视为美国国家安全战略的关键。 据2014年9月份的文章介绍,已经有几十家不同类型的美国企业安装了Accumulo技术系统,其中,美国20强企业中已有3家安装,50强企业中有5家安装,还有不少企业已表示对此有兴趣。 我一碰到KV存储方案,总想跟我用过的GemFire和MongoDB做个比较。vsChart.com - The Comparision Wiki上已经有现成的比较(见参考3和4),值得学习。 参考 Apache Accumulo官网 Accumulo: Why The World Needs Another NoSQL Database Apache Accumulo vs. GemFire Apache Accumulo vs. MongoDB NOSQL中文网:Apache Accumulo用户手册

MongoDB 3.0新特性、提升与兼容性改变

时间: 2015-03-07   |   分类: db+nosql     |   阅读: 18 字 ~1分钟
MONGODB 3.0 WHAT’S NEW IN MONGODB 3.0 Release Notes for MongoDB 3.0 Compatibility Changes in MongoDB 3.0 MongoDB3.0发布–新特性

粗览Activiti Modeler属性显示和设置代码

时间: 2015-03-06   |   分类: workflow     |   阅读: 28 字 ~1分钟
我的博文粗览Activiti Modeler操作和源代码介绍了Activiti ModelEditor组件的常用操作和对应源代码分析,本文接着介绍一下ActivitiModeler里BPMN元素属性的显示和设置。 粗览Activiti Modeler操作和源代码里提到的stencilset.json除了含有每个BPMN元素应该使用什么图标,也定义了每个BPMN元素的所有属性。以UserTask元素为例,它含有以下的属性包: “overrideidpackage” “namepackage” “documentationpackage” “asynchronousdefinitionpackage” “exclusivedefinitionpackage” “executionlistenerspackage” “multiinstance_typepackage” “multiinstance_cardinalitypackage” “multiinstance_collectionpackage” “multiinstance_variablepackage” “multiinstance_conditionpackage” “isforcompensationpackage” “usertaskassignmentpackage” “formkeydefinitionpackage” “duedatedefinitionpackage” “prioritydefinitionpackage” “formpropertiespackage” “tasklistenerspackage” [tomcat]\webapps\activiti-explorer\editor-app\configuration\properties.js里提供了对各类BPMNstencil的所需要包含的HTML页面。 [tomcat]\webapps\activiti-explorer\editor-app\stencil-controller.js中对ORYX.CONFIG.EVENT_SELECTION_CHANGED事件注册了匿名函数监听器。当某一BPMN元素被选中后,该监听器会设置$scope.selectedItem和$scope.selectedShape,其中包含BPMN元素的所有属性,每个属性都有对应的stencilreadModeTemplateUrl、writeModeTemplateUrl和templateUrl。 [tomcat]\webapps\activiti-explorer\editor-app\editor.html是ActivitiModelEditor组件的显示页面,其ID为propertiesHelpWrapper的DIV元素内对所选择的BPMN元素的每个属性放置templateUrl、readModeTemplateUrl或writeModeTemplateUrl对应的HTML子页面用于显示和设置stencil属性。 用于设置BPMNstencil属性的页面都位于[tomcat]\webapps\activiti-explorer\editor-app\configuration\properties\下。 这些页面和Anjugar.JS控制器为:

GoJS对浏览器和移动设备的支持

时间: 2015-03-04   |   分类: FrontEnd     |   阅读: 34 字 ~1分钟
在其官网上没有发现GoJS对浏览器和移动设备的支持的详细报告,仅在http://www.nwoods.com/products/gojs/ 有粗略介绍: GoJS takes advantage of the HTML Canvas to supporthigh-performance diagrams. For creating static documents andprintable resources, GoJS supports exporting Diagrams to images and SVG. GoJS supports all modern browsers (IE9+), including mobilebrowsers.
32 33 34 35 36 37 38 39 40

Programmer & Architect

662 日志
27 分类
1472 标签
RSS 订阅
GitHub Twitter FB Page
© 2009 - 2023 Mryqu's Notes
Powered by - Hugo v0.120.4
Theme by - NexT
0%