Git Product home page Git Product logo

memlink's People

Watchers

 avatar

memlink's Issues

Compile Patch for freebsd

Index: dumpfile.c
===================================================================
--- dumpfile.c  (版本 610)
+++ dumpfile.c  (工作副本)
@@ -45,7 +45,7 @@
     DINFO("dumpfile to tmp: %s\n", tmpfile);

    gettimeofday(&start, NULL);
-    FILE    *fp = fopen64(tmpfile, "wb");
+    FILE    *fp = fopen(tmpfile, "wb");

     unsigned short formatver = DUMP_FORMAT_VERSION;
     ffwrite(&formatver, sizeof(short), 1, fp);
@@ -140,7 +140,7 @@
    struct timeval start, end;

    gettimeofday(&start, NULL);
-    fp = fopen64(filename, "rb");
+    fp = fopen(filename, "rb");
     if (NULL == fp) {
         DERROR("open dumpfile %s error: %s\n", filename, strerror(errno));
         return -1;
@@ -291,7 +291,7 @@
     FILE    *dumpf;

     //dumpf = fopen(filename, "r");
-    dumpf = fopen64(filename, "r");
+    dumpf = fopen(filename, "r");
     if (dumpf == NULL) {
         DERROR("open file %s error! %s\n", filename, strerror(errno));
         return -1;
Index: SConstruct
===================================================================
--- SConstruct  (版本 610)
+++ SConstruct  (工作副本)
@@ -4,9 +4,9 @@
 #defs     = ['DEBUG', 'RANGE_MASK_STR']
 #defs     = ['DEBUG', "__USE_FILE_OFFSET64", "__USE_LARGEFILE64", "_LARGEFILE_SOURCE", "_LARGEFILE64_SOURCE", "_FILE_OFFSET_BITS=64", 'DEBUGMEM']
 defs     = ['DEBUG', "__USE_FILE_OFFSET64", "__USE_LARGEFILE64", "_LARGEFILE_SOURCE", "_LARGEFILE64_SOURCE", "_FILE_OFFSET_BITS=64"]
-includes = ['/Developer/usr/include', '.']
-libpath  = ['/Developer/usr/lib']
-libs     = ['event', 'm']
+includes = ['/Developer/usr/include', '.', '/usr/local/include']
+libpath  = ['/Developer/usr/lib', '/usr/local/lib', '/usr/lib']
+libs     = ['event', 'm', 'pthread']
 #libs     = ['event', 'm', 'tcmalloc_minimal']
 cflags   = "-ggdb -pthread -std=gnu99 -Wall -Werror -O2"

Index: network.c
===================================================================
--- network.c   (版本 610)
+++ network.c   (工作副本)
@@ -4,7 +4,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <netdb.h>
-#include <netinet/tcp.h>
+#include <netinet/in.h>
 #include<arpa/inet.h>
 #include <sys/types.h>
 #include <fcntl.h>
@@ -12,6 +12,7 @@
 #include "logfile.h"
 #include "myconfig.h"
 #include "network.h"
+#include <netinet/tcp.h>


 int 
Index: conn.c
===================================================================
--- conn.c  (版本 610)
+++ conn.c  (工作副本)
@@ -4,6 +4,7 @@
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
+#include <netinet/in.h>
 #ifdef __linux
 #include <linux/if.h>
 #endif

Index: synclog.c
===================================================================
--- synclog.c   (版本 610)
+++ synclog.c   (工作副本)
@@ -325,7 +325,7 @@
        FILE *fp = NULL;
        unsigned int offset = 0;

-       fp = fopen64(dumpfile, "rb");
+       fp = fopen(dumpfile, "rb");
        offset = sizeof(short) + sizeof(int);
        fseek(fp, offset, SEEK_SET);
        ret = ffread(&dumplogver, sizeof(int), 1, fp);
Index: sslave.c
===================================================================
--- sslave.c    (版本 610)
+++ sslave.c    (工作副本)
@@ -2,12 +2,12 @@
 #include <sys/socket.h>
 #include <netdb.h>
 #include <arpa/inet.h> 
-#include <netinet/tcp.h> 
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <sys/types.h>
+#include <netinet/tcp.h> 
 #include <fcntl.h>

 #include "logfile.h"
@@ -101,7 +101,7 @@

    FILE    *dumpf; 
    //dumpf = fopen(dumpfile, "r");
-   dumpf = (FILE*)fopen64(dumpfile, "r");
+   dumpf = (FILE*)fopen(dumpfile, "r");
    if (dumpf == NULL) {
        DERROR("open file %s error! %s\n", dumpfile, strerror(errno));
        return -1;

Original issue reported on code.google.com by [email protected] on 11 Jan 2011 at 8:25

编译不能通过

li117-184:~/memlink-read-only# scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o dumpfile.o -c -ggdb -pthread -std=gnu99 -Wall -Werror -DDEBUG 
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/Developer/usr/include -I. dumpfile.c
cc1: warnings being treated as errors
dumpfile.c: In function 'dumpfile_call_loop':
dumpfile.c:322: error: implicit declaration of function 'evutil_timerclear'
scons: *** [dumpfile.o] Error 1
scons: building terminated because of errors.



li117-184:~/memlink-read-only# gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1' 
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared 
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext 
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld 
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu 
--target=i486-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1.1) 

Original issue reported on code.google.com by [email protected] on 24 Nov 2010 at 11:23

synclog causes core

synclog causes core
memlink.log as following:
20110526 17:44:46 1115703616 wthread.c:918 [INFO] 2 20110526 18:06:24 
47789162584800 synclog.c:407 [ERR] index too small, at:3091656
6, index:377815
20110526 18:06:29 47521641487072 synclog.c:407 [ERR] index too small, 
at:30916566, index:377815
20110526 18:06:50 47256653691616 synclog.c:407 [ERR] index too small, 
at:30916566, index:377815


Original issue reported on code.google.com by [email protected] on 26 May 2011 at 10:22

cmd_range 中len过大会core

int
hashtable_range(HashTable *ht, char *key, unsigned char kind,
                unsigned int *maskarray, int masknum,
                int frompos, int len, Conn *conn)
{
  .....
int  wlen = CMD_REPLY_HEAD_LEN + 3 + node->masknum + (node->valuesize + 
node->masksize) * len;

len应该做一下判断,如果过大,应该使用list有效长度。

Original issue reported on code.google.com by [email protected] on 13 Jul 2011 at 10:27

字符串数据存储

看了memlink的相关文档,想请教下,memlink是不是只能存储整型
类型的数据?字符串类型的还是需要存储在MYSQL中?也就是说
memlink只存储mysql中的主键,而数据的实际内容还是存储在mysql
中,应用时先从memlink获取相关主键,然后再到mysql中查询?

Original issue reported on code.google.com by [email protected] on 16 Aug 2011 at 7:14

Code review request

Purpose of code changes on this branch:


When reviewing my code changes, please focus on:

add table param to client api 

After the review, I'll merge this branch into:
/trunk


Original issue reported on code.google.com by [email protected] on 30 Aug 2011 at 12:06

code review

What steps will reproduce the problem?
1. 
2. 
3. 

What is the expected output? What do you see instead?


Please use labels and text to provide additional information.





Original issue reported on code.google.com by [email protected] on 9 Oct 2010 at 6:06

请问mask到底是何意?

不知道这个项目还有在更新吗?好像去年到现在都没动静了��
�

研究了半天,安装和配置、启动都很顺利,可到了PHP客户端��
�用时,却无法创建成功。

找了原因,可能是没有正确设置mask,我查了这里所有文档,�
��有这段话“为value的属性格式。属性格式由冒号分隔的数字�
��成(如$maskformat = 
"4:3:1";)。这些数字表示对应属性项所占用的空间的bit数。比
如4:3:1表示有三个属性,这三个属性分别占用4bit,3bit,1bit。
属性的值必须为正整数,最大值为有符号4字节整型的最大值�
��支持的最大属性数量默认为16个。”说的最多,

但VALUE的属性,到底是什么属性?实在令人难以理解。

ISSUES里面也有人提到,说是随便设置便于统计,但我下面的��
�码随便设置就不行。

include_once("memlinkclient.php");
$host="127.0.0.1";
$readport="11001";
$writeport="11002";
$timeout = 10;
$m = new MemLinkClient($host,$readport,$writeport,$timeout);
$key = "test";

$value1="这是第一个值";
$value2="这是第二个值";
$value3="这是第三个值";
#$value1=sprintf("%012d", 1);  //数值也不行。
#$value2=sprintf("%012d", 2);
#$value3=sprintf("%012d", 3);

$valuesize=strlen($value1);
$ret=$m->rmkey($key); //delete old key
$maskformat = "4:3:1";  //试了"::"也不行。
$maskinsert = "8:1:1";

echo "<h3>创建一个键</h3>";

$ret = $m->create_list($key, $valuesize, $maskformat);
if ($ret != MEMLINK_OK) {
      echo "创建失败: $key,状态码$ret\n";
      exit;
}

在这里总是失败。$ret总是输出-28

麻烦你们解释一下mask具体含义和设置值,非常感谢!

Original issue reported on code.google.com by [email protected] on 30 Apr 2012 at 4:36

android API for memlink

This is a feature request.

Is there any plan for an Android API to access memlink server?

Thanks,
Xu


Original issue reported on code.google.com by [email protected] on 7 Feb 2012 at 10:49

test code review

Purpose of code changes on this branch:


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk


Original issue reported on code.google.com by [email protected] on 9 Oct 2010 at 6:14

Cannot redeclare class MemLink in /aloxc/www/php/memlink.php on line 358

What steps will reproduce the problem?
1. 
使用simpletest.php出现这样错误,memlink服务器已经启动了,这��
�什么错误
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 7 Jan 2011 at 5:57

one mistake in function "mempool_create"

What steps will reproduce the problem?
1. code review
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.
The second malloc should check mp->freemem is NULL pointer
--------------------------------------------------------------------------------
--------------
MemPool*    
mempool_create()
{
    MemPool *mp;

    mp = (MemPool*)zz_malloc(sizeof(MemPool));
    if (NULL == mp) {
        DERROR("malloc MemPool error!\n");
        return NULL;
    }
    memset(mp, 0, sizeof(MemPool));

    mp->size = MEMLINK_MEM_NUM;
    mp->freemem = (MemItem*)zz_malloc(sizeof(MemItem) * mp->size);
    if (NULL == mp) {       //---------should check mp->freemem is NULL pointer
        DERROR("malloc MemItem error!\n");
        zz_free(mp);
        return NULL;
    }
    memset(mp->freemem, 0, sizeof(MemItem) * mp->size);

    //g_mpool = mp;

    return mp;
}

Original issue reported on code.google.com by [email protected] on 12 Jul 2011 at 3:48

maskstr 到底是什么东西。。。

看了wiki,有点晕,老是看到 maskstr 
的出现。。。。都不知道这东西设置了有什么用,为什么要��
�置,该如何设置。
“maskstr为value的属性格式。该属性格式由问号分隔的数字组��
�。这些数字表示对应属性项所占用的空间的bit数。比如4:3:1��
�示有三个属 
性,这三个属性分别占用4bit,3bit,1bit。属性的值必须为正��
�数,最大值为有符号4字节整型的最大值。支持的最大属性数
量默认为16个。”
到底啥是属性格式。。。。。。。。。。。。。。。要怎样��
�置啊大哥 。。。。。

Original issue reported on code.google.com by [email protected] on 7 Aug 2011 at 1:22

服务器端意外关闭

运行 memlink-0.3.4/example/test_client.java 

服务器就会自动关闭,提示下面错误信息:
20110617 15:56:17 1093052736 memlink.c:33 [FATAL] ====== SIGSEGV handled ======
Aborted (core dumped)


客户端程序提示如下:
create error:-34
请问这个问题如何解决?是由于什么引起的呢?

Original issue reported on code.google.com by [email protected] on 17 Jun 2011 at 8:48

能否设置 memlink 占用内存的最大的大小?

想用 memlink 
在vps上用用,vps上的内存很小,大概512M,加上其他七七八八�
��用的差不多了,我在wiki上没有找到关于此项的相关设置,��
�问如果要设置的话该怎么做?


Original issue reported on code.google.com by [email protected] on 16 Aug 2011 at 12:22

有一个关于memlink过滤的问题想请教下。

import com.googlecode.memlink.*;
import java.util.*;
import java.lang.*;

public class test_client
{
    static {
        try{
            System.out.println("try load library: libcmemlink.so");
            System.loadLibrary("cmemlink");
        }catch (UnsatisfiedLinkError e) {
            System.err.println("library libcmemlink.so load error! " + e); 
            System.exit(1);
        }   
        System.out.println("load ok!");
    }

    public static void test_create_table(MemLinkClient m, String name)
    {
        int ret;
        int valuelen = 12;
        String maskformat = "4:3:1";

        ret = m.createTableList(name, valuelen, maskformat);
        if (0 != ret){
            System.out.println("create error:" + ret);
            return;
        }else{
            System.out.println("create " + name); 
        }
    }

    public static void test_insert(MemLinkClient m, String table , String key)
    {
        int i = 0;
        int ret = 0;
        int num = 12;
        //String value = "012345678912";

        for (i = 0; i < num; i++) {
            String value = String.format(i+1+"ccc");
            if(i == 0){
                ret = m.insert(table ,key, value.getBytes(), "8:3:2", 0);
            }else{
                ret = m.insert(table ,key, value.getBytes(), "8:3:1", 0);
            }

            if (0 != ret)
            {
                System.out.println("errr insert!");
                return;
            }
        }

        System.out.println("insert 200");               
    }

    public static void test_stat(MemLinkClient m, String table, String key)
    {        
        int ret;
        MemLinkStat stat = new MemLinkStat();
        ret = m.stat(table ,key, stat);
        if (cmemlink.MEMLINK_OK != ret)
        {
            System.out.println("errr stat!");
            return;
        }
        if (stat.getData() != 12 || stat.getData_used() != 12)
        {    
            System.out.println("errr stat result!");
            return;
        }
    }

    public static void test_range(MemLinkClient m, String table, String key)
    {        
        int ret;
        MemLinkResult rs = new MemLinkResult();
        ret = m.range(table , key, cmemlink.MEMLINK_VALUE_VISIBLE, "::3", 0, 12, rs);
        if (cmemlink.MEMLINK_OK != ret)
        {
            System.out.println("err range!");
            return;
        }
        System.out.println("range count: " + rs.getCount());
        MemLinkItem item = rs.getItems();
        while (null != item)
        {
            String v = new String(item.getValue());
            System.out.println("value: " + v + " length:" + v.length());
            item = item.getNext();
        }
    }

    public static void test_count(MemLinkClient m, String table, String key)
    {
        int ret;

        MemLinkCount count = new MemLinkCount();
        ret = m.count(table , key, "8:3:1", count);
        if (cmemlink.MEMLINK_OK != ret)
        {
            System.out.println("err count!");
            return;
        }
        System.out.println("count.visible: " + count.getVisible_count() + "\ncount.tagdel: " + count.getTagdel_count());                
    }


    public static void test_move(MemLinkClient m, String table, String key)
    {
        int ret;
        int i = 0;

        String value = String.format("%012d", i); //the last one
        ret = m.move( table ,key, value.getBytes(), 0); //move it to first
        if (0 != ret)
        {
            System.out.println("err tag");
            return;
        }
    }

    public static void test_tag(MemLinkClient m, String table, String key)
    {
        int ret;
        int i = 100;

        String value = String.format("%012d", i);
        ret = m.tag( table , key, value.getBytes(), cmemlink.MEMLINK_TAG_DEL); //tag value
        if (0 != ret)
        {
            System.out.println("err tag");
            return;
        }
    }

    public static void test_del(MemLinkClient m, String table, String key)
    {
        int ret;
        int i = 199;

        String value = String.format("%012d", i);
        ret = m.tag(table , key, value.getBytes(), cmemlink.MEMLINK_TAG_DEL);
        if (0 != ret)
        {
            System.out.println("err tag");
            return;
        }
    }

    public static void main(String [] args)
    {
        //String str = System.getProperty("java.library.path");
        //System.out.println(str);

        MemLinkClient m = new MemLinkClient("127.0.0.1", 11001, 11002, 10);
        String name = "testtable";
        String key = name + ".haha";

//      test_create_table(m, name);
//      test_insert(m, name, key);
//      test_stat(m, name, key);
//      System.out.println("\nrange1: ");
        test_range(m, name , key);
        test_count(m, name ,  key);
        //test_update(m, key);
//      test_tag(m,name ,  key);
//      test_del(m,name, key);
//      System.out.println("\nrange2: ");
//      test_range(m, name , key);

        m.destroy();
    }
}

试了最新的r802 
memlink,我用上面的java代码,我添加了attrstr为 8:3:1  和 attrstr 
8:3:2 两种数据,我用  ::1   range时候,可以匹配出 8:3:1的 ,  
用 ::2 可以匹配出 8:3:2  的数据,但是,为何我使用  ::3  
过滤时候,却把  8:3:1  
的数据匹配出来了,不是应该没有找到匹配的吗?   
难道memlink不支持这样的过滤吗?  

Original issue reported on code.google.com by [email protected] on 10 Sep 2011 at 4:28

libevent depend -_- !

What steps will reproduce the problem?
1. like redis impli by your self
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 19 Jan 2011 at 3:28

warnings in dumpfile.c

Since warning are treated as errors, scons fails to build memlink.

cc1: warnings being treated as errors
dumpfile.c: In function 'loaddump':
dumpfile.c:133: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:142: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:145: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:164: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:168: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:170: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:172: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:174: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:178: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
dumpfile.c:217: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result
scons: *** [dumpfile.o] Error 1
scons: building terminated because of errors.



Original issue reported on code.google.com by [email protected] on 19 Oct 2010 at 1:53

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.