Permalink
Browse files

Revision: 16603

  • Loading branch information...
1 parent cd77300 commit 2fcbac809bf8ee7d3c5b672024077feeeb1ebfc7 @wangzhonnew wangzhonnew committed Dec 19, 2014
View
@@ -159,6 +159,26 @@ Building Connectors:
make install
+Package RPM Prerequisites:
+-----------------
+ rpmbuild ( 4.8.0 )
+ scons ( 2.3.0 )
+ ant ( 1.8.2 )
+ Python ( 2.7.3 )
+ PostgreSQL ( 9.3.4 )
+ Linux x86-64:
+ g++ ( 4.3.4 )
+ gcc ( 4.3.4 )
+ make ( 3.81 )
+ kernel ( 3.0.13-0.27-default )
+
+
+Package RPM:
+-----------------
+ python script/package.py
+ # the RPM-package will output in package/output/RPMS/
+
+
Running:
-----------------
For command line options to start SequoiaDB, invoke:
@@ -1107,7 +1107,7 @@ static BOOLEAN jsonConvertBson ( cJSON *cj, bson *bs, BOOLEAN isObj )
free ( out ) ;
return FALSE ;
}
- out_len = strlen ( out ) ;
+ out_len = len - 1 ;
if ( 5 == cj->valueint &&
CJSON_MD5_16 != out_len &&
CJSON_MD5_32 != out_len &&
@@ -6,7 +6,7 @@
#define SDB_ENGINE_INCLUDE_AUTOGEN_RELATIVE_PATH "../../SequoiaDB/engine/include/"
#define SDB_ENGINE_OSSVER_FILE_RELATIVE_PATH SDB_ENGINE_INCLUDE_AUTOGEN_RELATIVE_PATH SDB_ENGINE_OSSVER_FILE
-#define SDB_ENGINE_RELEASE_CURRENT 16594
+#define SDB_ENGINE_RELEASE_CURRENT 16603
#define SDB_ENGINE_BUILD_FORMAT "%04d-%02d-%02d-%02d.%02d.%02d"
#define SDB_ENGINE_BUILD_CURRENT "0000-00-00-00.00.00"
@@ -9,9 +9,31 @@
<value>192.168.30.182:11810</value>
</property>
<property>
+ <name>sequoiadb.input.user</name>
+ <value>sdbadmin</value>
+ <description>default:null</description>
+ </property>
+ <property>
+ <name>sequoiadb.input.passwd</name>
+ <value>sdbadmin</value>
+ <description>default:null</description>
+ </property>
+
+ <property>
<name>sequoiadb.output.url</name>
<value>192.168.30.182:11810</value>
- </property>
+ </property>
+ <property>
+ <name>sequoiadb.output.user</name>
+ <value>sdbadmin</value>
+ <description>default:null</description>
+ </property>
+ <property>
+ <name>sequoiadb.output.passwd</name>
+ <value>sdbadmin</value>
+ <description>default:null</description>
+ </property>
+
<property>
<name>sequoiadb.in.collectionspace</name>
<value>chentest</value>
@@ -47,5 +69,9 @@
<value>{"CREDENT_NO":null,"ROLE":null}</value>
<description>default:null;JSON type</description>
</property>
+ <property>
+ <name>sequoiadb.preferedinstance</name>
+ <value>[slave/master/anyone/node(1-7)]</value>
+ </property>
</configuration>
@@ -26,11 +26,11 @@
/**
*
*
- * @className:SequoiadbReader
+ * @className锛歋equoiadbReader
*
- * @author: gaoshengjie
+ * @author锛�gaoshengjie
*
- * @createtime:2013年12月10日 下午4:33:34
+ * @createtime:2013骞�2鏈�0鏃�涓嬪崍4:33:34
*
* @changetime:TODO
*
@@ -50,8 +50,11 @@ public SequoiadbBlockReader(InputSplit inputSplit, Configuration conf){
if(inputSplit==null||!(inputSplit instanceof SdbBlockSplit)){
throw new IllegalArgumentException("the inputsplit is not SdbBlockSplit" );
}
- String collectionName = SequoiadbConfigUtil.getInCollectionName(conf);
- String collectionSpaceName = SequoiadbConfigUtil.getInCollectionSpaceName(conf);
+
+ String user = SequoiadbConfigUtil.getInputUser(conf);
+ String passwd = SequoiadbConfigUtil.getInputPasswd(conf);
+
+
String queryStr = SequoiadbConfigUtil.getQueryString(conf);
String selectorStr = SequoiadbConfigUtil.getSelectorString(conf);
@@ -61,7 +64,10 @@ public SequoiadbBlockReader(InputSplit inputSplit, Configuration conf){
throw new IllegalArgumentException(" the SdbBlockSplit.sdbaddr is null");
}
- this.sequoiadb = new Sequoiadb(this.sdbBlockSplit.getSdbAddr().getHost(), this.sdbBlockSplit.getSdbAddr().getPort(),null,null);
+ String collectionName = this.sdbBlockSplit.getCollectionName();
+ String collectionSpaceName = this.sdbBlockSplit.getCollectionSpaceName();
+
+ this.sequoiadb = new Sequoiadb(this.sdbBlockSplit.getSdbAddr().getHost(), this.sdbBlockSplit.getSdbAddr().getPort(),user,passwd);
CollectionSpace collectionSpace=sequoiadb.getCollectionSpace(collectionSpaceName);
if(collectionSpace==null){
throw new IllegalArgumentException(" the CS not exists");
@@ -84,21 +90,25 @@ public SequoiadbBlockReader(InputSplit inputSplit, Configuration conf){
BSONObject selectorBson = null;
BSONObject orderbyBson = null;
- if ( queryStr != null){ //格式有问题
+ if ( queryStr != null){ //鏍煎紡鏈夐棶棰�
try {
queryBson = (BSONObject) JSON.parse( queryStr );
} catch (Exception e) {
+ log.warn("query string is error");
+ queryBson = null;
}
- log.info( "queryBson = " + queryBson.toString() );
+ log.debug( "queryBson = " + queryBson.toString() );
}
- if ( selectorStr != null){ //格式有问题
+ if ( selectorStr != null){ //鏍煎紡鏈夐棶棰�
try {
selectorBson = (BSONObject) JSON.parse( selectorStr );
selectorBson.put("_id", null);
} catch (Exception e) {
+ log.warn("selector string is error");
+ selectorBson = null;
}
- log.info( "selectorBson = " + selectorBson.toString() );
+ log.debug( "selectorBson = " + selectorBson.toString() );
}
this.cursor=dbCollection.query( queryBson,
@@ -69,11 +69,10 @@ public ObjectId getBsonId(){
private String writeType = null;
public SequoiadbWriter(String collectionSpaceName, String collectionName,
- SdbConnAddr sdbConnAddr, int bulkNum, String writeType) {
+ SdbConnAddr sdbConnAddr, String user, String passwd, int bulkNum, String writeType) {
super();
this.sequoiadb = new Sequoiadb(sdbConnAddr.getHost(),
- sdbConnAddr.getPort(), null, null);
- log.info("collectionSpaceName:"+collectionSpaceName+"---collectionName:"+collectionName);
+ sdbConnAddr.getPort(), user, passwd);
CollectionSpace space=null;
if(sequoiadb.isCollectionSpaceExist(collectionSpaceName)){
@@ -96,15 +95,14 @@ public SequoiadbWriter(String collectionSpaceName, String collectionName,
log.warn("writeType != bulkinsert and writeType != upsert,use default value");
this.writeType = "upsert";
}
- log.info("writeType = " + this.writeType);
+ log.debug("writeType = " + this.writeType);
}
public SequoiadbWriter(String collectionSpaceName, String collectionName,
- SdbConnAddr sdbConnAddr, String writeType) {
+ SdbConnAddr sdbConnAddr, String user, String passwd, String writeType) {
super();
this.sequoiadb = new Sequoiadb(sdbConnAddr.getHost(),
- sdbConnAddr.getPort(), null, null);
- log.info("collectionSpaceName:"+collectionSpaceName+"---collectionName:"+collectionName);
+ sdbConnAddr.getPort(), user, passwd);
CollectionSpace space=null;
if(sequoiadb.isCollectionSpaceExist(collectionSpaceName)){
@@ -126,7 +124,7 @@ public SequoiadbWriter(String collectionSpaceName, String collectionName,
log.warn("writeType != bulkinsert and writeType != upsert,use default value");
this.writeType = "upsert";
}
- log.info("writeType = " + this.writeType);
+ log.debug("writeType = " + this.writeType);
}
@Override
@@ -27,11 +27,11 @@
/**
*
*
- * @className:SequoiadbInputFormat
+ * @className锛歋equoiadbInputFormat
*
- * @author: gaoshengjie
+ * @author锛�gaoshengjie
*
- * @createtime:2013年12月11日 上午10:14:14
+ * @createtime:2013骞�2鏈�1鏃�涓婂崍10:14:14
*
* @changetime:TODO
*
@@ -27,6 +27,8 @@
private String collectionSpaceName;
private String collectionName;
private SdbConnAddr[] sdbConnAddr;
+ private String user;
+ private String passwd;
@Override
public Configuration getConf() {
@@ -40,6 +42,9 @@ public void setConf(Configuration configuration) {
this.collectionSpaceName = SequoiadbConfigUtil
.getOutCollectionSpaceName(conf);
+ this.user = SequoiadbConfigUtil.getOutputUser(conf);
+ this.passwd = SequoiadbConfigUtil.getOutputPasswd(conf);
+
String urlStr = SequoiadbConfigUtil.getOutputURL(conf);
if (urlStr == null) {
@@ -104,7 +109,7 @@ public RecordWriter getRecordWriter(TaskAttemptContext arg0)
log.debug("Select coord address:" + localAddrList.get(i).toString());
return new SequoiadbWriter(collectionSpaceName, collectionName,
- localAddrList.get(i), "upsert");
+ localAddrList.get(i), user, passwd, "upsert");
}
}
@@ -24,6 +24,8 @@
private String collectionName;
private int bulkNum;
private SdbConnAddr[] sdbConnAddr;
+ private String user;
+ private String passwd;
public SequoiadbOutputFormat() {
@@ -77,7 +79,7 @@ public RecordWriter getRecordWriter(TaskAttemptContext taskAttemptContext)
log.debug("Select coord address:" + localAddrList.get(i).toString());
return new SequoiadbWriter(collectionSpaceName, collectionName,
- localAddrList.get(i), bulkNum, "bulkinsert");
+ localAddrList.get(i), user, passwd, bulkNum, "bulkinsert");
}
private Configuration conf;
@@ -94,6 +96,8 @@ public void setConf(Configuration configuration) {
this.collectionSpaceName = SequoiadbConfigUtil
.getOutCollectionSpaceName(conf);
String bulkNumStr = SequoiadbConfigUtil.getOutputBulknum(conf);
+ this.user = SequoiadbConfigUtil.getOutputUser(conf);
+ this.passwd = SequoiadbConfigUtil.getOutputPasswd(conf);
if (bulkNumStr != null) {
try{
@@ -32,19 +32,31 @@
private SdbConnAddr sdbAddr;
private String scanType;
private int dataBlockId;
+ private String collectionSpaceName = null;
+ private String collectionName = null;
public SdbBlockSplit() {
super();
}
public SdbBlockSplit(SdbConnAddr sdbAddr, String scanType,
- int dataBlockId) {
+ int dataBlockId, String colletionSpaceName, String collectionName) {
super();
this.sdbAddr = sdbAddr;
this.scanType = scanType;
this.dataBlockId = dataBlockId;
+ this.collectionSpaceName = colletionSpaceName;
+ this.collectionName = collectionName;
}
+ public String getCollectionSpaceName()
+ {
+ return this.collectionSpaceName;
+ }
+ public String getCollectionName()
+ {
+ return this.collectionName;
+ }
public SdbConnAddr getSdbAddr() {
return sdbAddr;
}
@@ -86,6 +98,8 @@ public void readFields(DataInput in) throws IOException {
sdbAddr.setPort(in.readInt());
scanType=in.readUTF();
dataBlockId=in.readInt();
+ collectionSpaceName = in.readUTF();
+ collectionName = in.readUTF();
}
@Override
@@ -100,6 +114,8 @@ public void write(DataOutput out) throws IOException {
out.writeInt(this.sdbAddr.getPort());
out.writeUTF(this.scanType);
out.writeInt(this.dataBlockId);
+ out.writeUTF(this.collectionSpaceName);
+ out.writeUTF(this.collectionName);
}
Oops, something went wrong.

0 comments on commit 2fcbac8

Please sign in to comment.