Lines Matching refs:j
94 int maxline, j; in clusterLoadConfig() local
141 for (j = 1; j < argc; j += 2) { in clusterLoadConfig()
142 if (strcasecmp(argv[j],"currentEpoch") == 0) { in clusterLoadConfig()
144 strtoull(argv[j+1],NULL,10); in clusterLoadConfig()
145 } else if (strcasecmp(argv[j],"lastVoteEpoch") == 0) { in clusterLoadConfig()
147 strtoull(argv[j+1],NULL,10); in clusterLoadConfig()
151 argv[j]); in clusterLoadConfig()
223 for (j = 8; j < argc; j++) { in clusterLoadConfig()
226 if (argv[j][0] == '[') { in clusterLoadConfig()
232 p = strchr(argv[j],'-'); in clusterLoadConfig()
236 slot = atoi(argv[j]+1); in clusterLoadConfig()
249 } else if ((p = strchr(argv[j],'-')) != NULL) { in clusterLoadConfig()
251 start = atoi(argv[j]); in clusterLoadConfig()
254 start = stop = atoi(argv[j]); in clusterLoadConfig()
459 int j; in clusterInit() local
461 for (j = 0; j < server.cfd_count; j++) { in clusterInit()
462 if (aeCreateFileEvent(server.el, server.cfd[j], AE_READABLE, in clusterInit()
492 int j; in clusterReset() local
506 for (j = 0; j < CLUSTER_SLOTS; j++) clusterDelSlot(j); in clusterReset()
778 int j; in clusterNodeRemoveSlave() local
780 for (j = 0; j < master->numslaves; j++) { in clusterNodeRemoveSlave()
781 if (master->slaves[j] == slave) { in clusterNodeRemoveSlave()
782 if ((j+1) < master->numslaves) { in clusterNodeRemoveSlave()
783 int remaining_slaves = (master->numslaves - j) - 1; in clusterNodeRemoveSlave()
784 memmove(master->slaves+j,master->slaves+(j+1), in clusterNodeRemoveSlave()
797 int j; in clusterNodeAddSlave() local
800 for (j = 0; j < master->numslaves; j++) in clusterNodeAddSlave()
801 if (master->slaves[j] == slave) return C_ERR; in clusterNodeAddSlave()
811 int j, okslaves = 0; in clusterCountNonFailingSlaves() local
813 for (j = 0; j < n->numslaves; j++) in clusterCountNonFailingSlaves()
814 if (!nodeFailed(n->slaves[j])) okslaves++; in clusterCountNonFailingSlaves()
821 int j; in freeClusterNode() local
825 for (j = 0; j < n->numslaves; j++) in freeClusterNode()
826 n->slaves[j]->slaveof = NULL; in freeClusterNode()
864 int j; in clusterDelNode() local
869 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterDelNode()
870 if (server.cluster->importing_slots_from[j] == delnode) in clusterDelNode()
871 server.cluster->importing_slots_from[j] = NULL; in clusterDelNode()
872 if (server.cluster->migrating_slots_to[j] == delnode) in clusterDelNode()
873 server.cluster->migrating_slots_to[j] = NULL; in clusterDelNode()
874 if (server.cluster->slots[j] == delnode) in clusterDelNode()
875 clusterDelSlot(j); in clusterDelNode()
1443 int j; in clusterUpdateSlotsConfigWith() local
1465 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterUpdateSlotsConfigWith()
1466 if (bitmapTestBit(slots,j)) { in clusterUpdateSlotsConfigWith()
1468 if (server.cluster->slots[j] == sender) continue; in clusterUpdateSlotsConfigWith()
1474 if (server.cluster->importing_slots_from[j]) continue; in clusterUpdateSlotsConfigWith()
1480 if (server.cluster->slots[j] == NULL || in clusterUpdateSlotsConfigWith()
1481 server.cluster->slots[j]->configEpoch < senderConfigEpoch) in clusterUpdateSlotsConfigWith()
1485 if (server.cluster->slots[j] == myself && in clusterUpdateSlotsConfigWith()
1486 countKeysInSlot(j) && in clusterUpdateSlotsConfigWith()
1489 dirty_slots[dirty_slots_count] = j; in clusterUpdateSlotsConfigWith()
1493 if (server.cluster->slots[j] == curmaster) in clusterUpdateSlotsConfigWith()
1495 clusterDelSlot(j); in clusterUpdateSlotsConfigWith()
1496 clusterAddSlot(sender,j); in clusterUpdateSlotsConfigWith()
1527 for (j = 0; j < dirty_slots_count; j++) in clusterUpdateSlotsConfigWith()
1528 delKeysInSlot(dirty_slots[j]); in clusterUpdateSlotsConfigWith()
1847 int j; in clusterProcessPacket() local
1849 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterProcessPacket()
1850 if (bitmapTestBit(hdr->myslots,j)) { in clusterProcessPacket()
1851 if (server.cluster->slots[j] == sender || in clusterProcessPacket()
1852 server.cluster->slots[j] == NULL) continue; in clusterProcessPacket()
1853 if (server.cluster->slots[j]->configEpoch > in clusterProcessPacket()
1859 sender->name, server.cluster->slots[j]->name); in clusterProcessPacket()
1861 server.cluster->slots[j]); in clusterProcessPacket()
2239 int j; in clusterSendPing() local
2263 for (j = 0; j < gossipcount; j++) { in clusterSendPing()
2264 if (memcmp(hdr->data.ping.gossip[j].nodename,this->name, in clusterSendPing()
2267 if (j != gossipcount) continue; in clusterSendPing()
2472 int j; in clusterSendFailoverAuthIfNeeded() local
2541 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterSendFailoverAuthIfNeeded()
2542 if (bitmapTestBit(claimed_slots, j) == 0) continue; in clusterSendFailoverAuthIfNeeded()
2543 if (server.cluster->slots[j] == NULL || in clusterSendFailoverAuthIfNeeded()
2544 server.cluster->slots[j]->configEpoch <= requestConfigEpoch) in clusterSendFailoverAuthIfNeeded()
2554 node->name, j, in clusterSendFailoverAuthIfNeeded()
2555 (unsigned long long) server.cluster->slots[j]->configEpoch, in clusterSendFailoverAuthIfNeeded()
2582 int j, rank = 0; in clusterGetSlaveRank() local
2590 for (j = 0; j < master->numslaves; j++) in clusterGetSlaveRank()
2591 if (master->slaves[j] != myself && in clusterGetSlaveRank()
2592 master->slaves[j]->repl_offset > myoffset) rank++; in clusterGetSlaveRank()
2667 int j; in clusterFailoverReplaceYourMaster() local
2677 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterFailoverReplaceYourMaster()
2678 if (clusterNodeGetSlotBit(oldmaster,j)) { in clusterFailoverReplaceYourMaster()
2679 clusterDelSlot(j); in clusterFailoverReplaceYourMaster()
2680 clusterAddSlot(myself,j); in clusterFailoverReplaceYourMaster()
2899 int j, okslaves = 0; in clusterHandleSlaveMigration() local
2910 for (j = 0; j < mymaster->numslaves; j++) in clusterHandleSlaveMigration()
2911 if (!nodeFailed(mymaster->slaves[j]) && in clusterHandleSlaveMigration()
2912 !nodeTimedOut(mymaster->slaves[j])) okslaves++; in clusterHandleSlaveMigration()
2956 for (j = 0; j < node->numslaves; j++) { in clusterHandleSlaveMigration()
2957 if (memcmp(node->slaves[j]->name, in clusterHandleSlaveMigration()
2961 candidate = node->slaves[j]; in clusterHandleSlaveMigration()
3153 int j; in clusterCron() local
3157 for (j = 0; j < 5; j++) { in clusterCron()
3440 int deleted = 0, j; in clusterDelNodeSlots() local
3442 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterDelNodeSlots()
3443 if (clusterNodeGetSlotBit(node,j)) clusterDelSlot(j); in clusterDelNodeSlots()
3471 int j, new_state; in clusterUpdateState() local
3495 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterUpdateState()
3496 if (server.cluster->slots[j] == NULL || in clusterUpdateState()
3497 server.cluster->slots[j]->flags & (CLUSTER_NODE_FAIL)) in clusterUpdateState()
3589 int j; in verifyClusterConfigWithData() local
3597 for (j = 1; j < server.dbnum; j++) { in verifyClusterConfigWithData()
3598 if (dictSize(server.db[j].dict)) return C_ERR; in verifyClusterConfigWithData()
3603 for (j = 0; j < CLUSTER_SLOTS; j++) { in verifyClusterConfigWithData()
3604 if (!countKeysInSlot(j)) continue; /* No keys in this slot. */ in verifyClusterConfigWithData()
3608 if (server.cluster->slots[j] == myself || in verifyClusterConfigWithData()
3609 server.cluster->importing_slots_from[j] != NULL) continue; in verifyClusterConfigWithData()
3617 if (server.cluster->slots[j] == NULL) { in verifyClusterConfigWithData()
3619 "Taking responsibility for it.",j); in verifyClusterConfigWithData()
3620 clusterAddSlot(myself,j); in verifyClusterConfigWithData()
3624 "Setting it to importing state.",j); in verifyClusterConfigWithData()
3625 server.cluster->importing_slots_from[j] = server.cluster->slots[j]; in verifyClusterConfigWithData()
3696 int j, start; in clusterGenNodeDescription() local
3724 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterGenNodeDescription()
3727 if ((bit = clusterNodeGetSlotBit(node,j)) != 0) { in clusterGenNodeDescription()
3728 if (start == -1) start = j; in clusterGenNodeDescription()
3730 if (start != -1 && (!bit || j == CLUSTER_SLOTS-1)) { in clusterGenNodeDescription()
3731 if (bit && j == CLUSTER_SLOTS-1) j++; in clusterGenNodeDescription()
3733 if (start == j-1) { in clusterGenNodeDescription()
3736 ci = sdscatprintf(ci," %d-%d",start,j-1); in clusterGenNodeDescription()
3746 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterGenNodeDescription()
3747 if (server.cluster->migrating_slots_to[j]) { in clusterGenNodeDescription()
3748 ci = sdscatprintf(ci," [%d->-%.40s]",j, in clusterGenNodeDescription()
3749 server.cluster->migrating_slots_to[j]->name); in clusterGenNodeDescription()
3750 } else if (server.cluster->importing_slots_from[j]) { in clusterGenNodeDescription()
3751 ci = sdscatprintf(ci," [%d-<-%.40s]",j, in clusterGenNodeDescription()
3752 server.cluster->importing_slots_from[j]->name); in clusterGenNodeDescription()
3825 int j = 0, start = -1; in clusterReplyMultiBulkSlots() local
3831 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterReplyMultiBulkSlots()
3834 if ((bit = clusterNodeGetSlotBit(node,j)) != 0) { in clusterReplyMultiBulkSlots()
3835 if (start == -1) start = j; in clusterReplyMultiBulkSlots()
3837 if (start != -1 && (!bit || j == CLUSTER_SLOTS-1)) { in clusterReplyMultiBulkSlots()
3841 if (bit && j == CLUSTER_SLOTS-1) j++; in clusterReplyMultiBulkSlots()
3845 if (start == j-1) { in clusterReplyMultiBulkSlots()
3850 addReplyLongLong(c, j-1); /* high */ in clusterReplyMultiBulkSlots()
3931 int j, slot; in clusterCommand() local
3938 for (j = 2; j < c->argc; j++) { in clusterCommand()
3939 if ((slot = getSlotOrReply(c,c->argv[j])) == -1) { in clusterCommand()
3959 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterCommand()
3960 if (slots[j]) { in clusterCommand()
3965 if (server.cluster->importing_slots_from[j]) in clusterCommand()
3966 server.cluster->importing_slots_from[j] = NULL; in clusterCommand()
3968 retval = del ? clusterDelSlot(j) : in clusterCommand()
3969 clusterAddSlot(myself,j); in clusterCommand()
4085 int j; in clusterCommand() local
4087 for (j = 0; j < CLUSTER_SLOTS; j++) { in clusterCommand()
4088 clusterNode *n = server.cluster->slots[j]; in clusterCommand()
4159 unsigned int numkeys, j; in clusterCommand() local
4175 for (j = 0; j < numkeys; j++) addReplyBulk(c,keys[j]); in clusterCommand()
4236 int j; in clusterCommand() local
4250 for (j = 0; j < n->numslaves; j++) { in clusterCommand()
4251 sds ni = clusterGenNodeDescription(n->slaves[j]); in clusterCommand()
4475 int j, type, replace = 0; in restoreCommand() local
4479 for (j = 4; j < c->argc; j++) { in restoreCommand()
4480 if (!strcasecmp(c->argv[j]->ptr,"replace")) { in restoreCommand()
4652 int copy, replace, j; in migrateCommand() local
4673 for (j = 6; j < c->argc; j++) { in migrateCommand()
4674 if (!strcasecmp(c->argv[j]->ptr,"copy")) { in migrateCommand()
4676 } else if (!strcasecmp(c->argv[j]->ptr,"replace")) { in migrateCommand()
4678 } else if (!strcasecmp(c->argv[j]->ptr,"keys")) { in migrateCommand()
4685 first_key = j+1; in migrateCommand()
4686 num_keys = c->argc - j - 1; in migrateCommand()
4711 for (j = 0; j < num_keys; j++) { in migrateCommand()
4712 if ((ov[oi] = lookupKeyRead(c->db,c->argv[first_key+j])) != NULL) { in migrateCommand()
4713 kv[oi] = c->argv[first_key+j]; in migrateCommand()
4745 for (j = 0; j < num_keys; j++) { in migrateCommand()
4746 expireat = getExpire(c->db,kv[j]); in migrateCommand()
4757 serverAssertWithInfo(c,NULL,sdsEncodedObject(kv[j])); in migrateCommand()
4758 serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,kv[j]->ptr, in migrateCommand()
4759 sdslen(kv[j]->ptr))); in migrateCommand()
4764 createDumpPayload(&payload,ov[j]); in migrateCommand()
4808 for (j = 0; j < num_keys; j++) { in migrateCommand()
4824 dbDelete(c->db,kv[j]); in migrateCommand()
4825 signalModifiedKey(c->db,kv[j]); in migrateCommand()
4829 newargv[del_idx++] = kv[j]; in migrateCommand()
4830 incrRefCount(kv[j]); in migrateCommand()
4838 if (!error_from_target && socket_error && j == 0 && may_retry && in migrateCommand()
5009 int margc, *keyindex, numkeys, j; in getNodeByQuery() local
5016 for (j = 0; j < numkeys; j++) { in getNodeByQuery()
5017 robj *thiskey = margv[keyindex[j]]; in getNodeByQuery()