首页 \ 问答 \ javac和java 有什么区别和联系?

javac和java 有什么区别和联系?

javac和java 有什么区别和联系?
更新时间:2022-10-27 14:10

最新回答

如何使用Spark/Scala读取Hbase的数据
必须使用高亮参数启动Spark-shell,否则当你遍历RDD时会出现如下的Exception
java.io.NotSerializableException: org.apache.hadoop.hbase.io.ImmutableBytesWritable
spark-shell--conf spark.serializer=org.apache.spark.serializer.KryoSerializer
以下代码,经过MaprDB实测通过
import org.apache.spark._
import org.apache.spark.rdd.NewHadoopRDD
import org.apache.hadoop.hbase.{HBaseConfiguration, HTableDescriptor}
import org.apache.hadoop.hbase.client.HBaseAdmin
import org.apache.hadoop.hbase.mapreduce.TableInputFormat
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HColumnDescriptor
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.HTable;
val tableName = "/app/SubscriptionBillingPlatform/TRANSAC_ID"
val conf = HBaseConfiguration.create()
conf.set(TableInputFormat.INPUT_TABLE, tableName)
//create rdd
val hBaseRDD = sc.newAPIHadoopRDD(conf, classOf[TableInputFormat], 
  classOf[org.apache.hadoop.hbase.io.ImmutableBytesWritable],
  classOf[org.apache.hadoop.hbase.client.Result])
hBaseRDD.take(2).map(row=>row._2.rawCells).
      map(_.map( kv => (new String(kv.getQualifier()) -> new 
String(kv.getValue()) ) ).toMap ).     foreach( map => { map.foreach{
 entry => print(entry._1 +":" + entry._2 + ", ")  } ; 
print("\n-----------\n") }  )       
//get the row count
val count = hBaseRDD.count()
print("HBase RDD count:"+count)
java.io.notserializableexception: org.apache.hadoop.hbase.io.immutablebyteswritable
spark-shell--conf spark.serializer=org.apache.spark.serializer.kryoserializer
以下代码,经过maprdb实测通过
import org.apache.spark._
import org.apache.spark.rdd.newhadooprdd
import org.apache.hadoop.hbase.{hbaseconfiguration, htabledescriptor}
import org.apache.hadoop.hbase.client.hbaseadmin

相关问答

更多
  • 必须使用高亮参数启动Spark-shell,否则当你遍历RDD时会出现如下的Exception java.io.NotSerializableException: org.apache.hadoop.hbase.io.ImmutableBytesWritable spark-shell--conf spark.serializer=org.apache.spark.serializer.KryoSerializer 以下代码,经过MaprDB实测通过 import org.apache.spark._ im ...
  • Configuration conf = HBaseConfiguration.create();   String tableName = "testTable";   Scan scan = new Scan();   scan.setCaching(10000);   scan.setCacheBlocks(false);   conf.set(TableInputFormat.INPUT_TABLE, tableName);   ClientProtos.Scan proto = ProtobufU ...
  • hbase的region是按行划分,而非按列,如果你读取指定一行的所有列数据,regionServer虽然无法保证你的所有数据都在一个HFile中,但是至少是在一个Region中。但是具体的HFile所在的hdfs的节点那就不是HBase关心的事了,因为HBase的存储是依赖与hd...
  • 使用Spark(Scala)读取HBase数据的基本示例,您还可以使用Java来描述这一点: import org.apache.hadoop.hbase.client.{HBaseAdmin, Result} import org.apache.hadoop.hbase.{ HBaseConfiguration, HTableDescriptor } import org.apache.hadoop.hbase.mapreduce.TableInputFormat import org.apache.ha ...
  • 首先,SBT找不到类HBaseConf 。 这是因为您已导入org.apache.hadoop.hbase.HBaseConfiguration ,但您需要的类是unicredit.spark.hbase.HBaseConf 。 你的第二个问题是 value hbase is not a member of org.apache.spark.streaming.StreamingContextvalue hbase is not a member of org.apache.spark.streaming. ...
  • Splice Machine(开源)有一个演示火花流运行的演示。 http://community.splicemachine.com/category/tutorials/data-ingestion-streaming/ 以下是此用例的示例代码。 https://github.com/splicemachine/splice-community-sample-code/tree/master/tutorial-kafka-spark-streaming Splice Machine (Open Sour ...
  • 你可以按照下面的例子 import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.ZooKeeperConnectionException; im ...
  • 好吧显然这是一个意想不到的依赖问题(因为它始终没有任何意义)。 这些是我为解决这个问题而采取的步骤(希望它们能帮助未来的开发人员): 我使用完全相同的代码创建了一个干净的项目。 这没有任何问题立即让我怀疑它是某种依赖性问题 为了确保,我将HBase依赖项放在依赖项的顶部。 这创建了一个与Spark和安全性相关的异常,更具体地说:javax.servlet.FilterRegistration 然后我遇到了这个有用的解决方案,为我解决了这个问题。 我不得不从我的pom中排除所有的javax和mortbay码头 ...
  • 想出来 - 首先新表需要已经存在。 我曾经认为save()命令会创建它,但不是。 此外,新表必须具有您要保存的列族 - 此处“cf” Figured it out - first the new table needs to already exist. I had thought the save() command would create it, but no. Also, the new table has to have the column family you're saving to - h ...
  • foreachRDD在个别执行程序jvm进程上执行。 至少你可以在transferToHBasePut方法中获得conf的单例实例(意味着在使用现有的jvm进程集合或新的conf之前进行空值检查)。 因此,这将减少Hbase与Spark群集中生成的执行程序数量的连接数。 希望这可以帮助... foreachRDD executes on individual executors jvm process. At least you can get the singleton instance of conf( ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。